[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Is it a file system code bug?
From:       Zhihui Zhang <zzhang () cs ! binghamton ! edu>
Date:       2002-04-24 23:16:22
[Download RAW message or body]


In routine ffs_balloc(), after we have determined that the block is
already there, we use the following statement to read the block in:

        if (flags & B_CLRBUF) {
                error = bread(vp, lbn, (int)fs->fs_bsize, NOCRED, &nbp);
                if (error) {
                        brelse(nbp);
                        goto fail;
                }
        } else {
		nbp = getblk(vp, lbn, fs->fs_bsize, 0, 0);
		nbp->b_blkno = fsbtodb(fs, nb);
	}

The semantics of B_CLRBUF is confusing here. Even if it is allowed to be
twisted a little bit, what about the case when we are writing a FULL
block?  Do we still have to read its old contents back which is going to
be erased entirely?  Note that ufs_write() always sets B_CLRBUF.

Thanks for any enlightenment.

-Zhihui


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic