Date: Wed, 24 Apr 2002 19:16:22 -0400 (EDT) From: Zhihui Zhang <zzhang@cs.binghamton.edu> To: freebsd-hackers@freebsd.org Subject: Is it a file system code bug? Message-ID: <Pine.SOL.4.21.0204241911270.10259-100000@onyx>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.4.21.0204241911270.10259-100000>