Project

General

Profile

Bug #10163

ufs_fsck: bitwise comparison always evaluates to false

Added by Toomas Soome 7 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
2018-12-25
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:

Description

Issue found by gcc 8 build:

    pass2.c: In function 'pass2':
    pass2.c:243:42: error: bitwise comparison always evaluates to false [-Werror=tautological-compare]
       if ((statemap[inp->i_number] & STMASK) == DCLEAR ||
                                              ^~
    cc1: all warnings being treated as errors

DCLEAR is defined as:

#define    DCLEAR    (DSTATE | INCLEAR)

but since INCLEAR is defined outside of STMASK, we can not use just STMASK for this test.

History

#1

Updated by Toomas Soome 5 months ago

Testing: I did create ufs with newfs and did start the copy of usr tree with tar pipe, and from middle of copy did reboot.

fstyp -v:
ufs
magic 11954 format dynamic time Thu Feb 21 12:58:02 2019
sblkno 16 cblkno 24 iblkno 32 dblkno 760
sbsize 2048 cgsize 8192 cgoffset 64 cgmask 0xffffffc0
ncg 427 size 20954752 blocks 20637041
bsize 8192 shift 13 mask 0xffffe000
fsize 1024 shift 10 mask 0xfffffc00
frag 8 shift 3 fsbtodb 1
minfree 1% maxbpg 2048 optim time
maxcontig 128 rotdelay 0ms rps 40
csaddr 760 cssize 7168 shift 9 mask 0xfffffe00
ntrak 48 nsect 128 spc 6144 ncyl 6822
cpg 16 bpg 6144 fpg 49152 ipg 5824
nindir 2048 inopb 64 nspf 2
nbfree 2563348 ndir 1806 nifree 2471177 nffree 34
cgrotor 29 fmod 0 ronly 0 logbno 98304
rolled 1 si 0 flags 0
version 2
fs_reclaim is not set
file system state is valid, fsclean is -3

root@test:/home/tsoome# fsck /dev/rdsk/c2t5d0s0
  • /dev/rdsk/c2t5d0s0
  • Last Mounted on /mnt
  • Phase 1 - Check Blocks and Sizes
  • Phase 2 - Check Pathnames
  • Phase 3a - Check Connectivity
  • Phase 3b - Verify Shadows/ACLs
  • Phase 4 - Check Reference Counts
  • Phase 5 - Check Cylinder Groups
    15669 files, 109751 used, 20506818 free (34 frags, 2563348 blocks, 0.0% fragmentation)

Sure, such test is just very basic one... but at least something:D

#2

Updated by Electric Monk 5 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit ebc6491a5a66ba44ff1a3fa2a627e67d665604f0

commit  ebc6491a5a66ba44ff1a3fa2a627e67d665604f0
Author: Toomas Soome <tsoome@me.com>
Date:   2019-02-25T15:45:05.000Z

    10163 ufs_fsck: bitwise comparison always evaluates to false
    Reviewed by: Gergő Doma <domag02@gmail.com>
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF