[email protected] (Maxime Villard) writes:

>Hi,
>this may be a stupid question; in ufs/ffs/ffs_vfsops.c, l.1153:

>       if (fs->fs_sbsize < SBLOCKSIZE)
>               brelse(bp, BC_INVAL);
>       else
>               brelse(bp, 0);

>However 'fs->fs_sbsize' is *always* smaller than SBLOCKSIZE. So only
>the first branch is reached.

It can also be equal to SBLOCKSIZE (or larger than SBLOCKSIZE if corrupted).


>I don't understand what the BC_INVAL flag means, and its definition
>in sys/buf.h is not very enlightening:

>       #define BC_INVAL        0x00002000      /* Does not contain valid info. 
> */

BC_INVAL means, there is no data in the buffer that could be reused.
The buffer will be put at the head of the freelist.

I don't think that the check makes any sense, but an equivalent already
existed since the beginning:

        if (fs->fs_sbsize < SBSIZE)
                bp->b_flags |= B_INVAL;
        brelse(bp);

-- 
-- 
                                Michael van Elst
Internet: [email protected]
                                "A potential Snark may lurk in every tree."

Reply via email to