From owner-freebsd-hackers Wed Apr 24 21:47:39 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from bingnet2.cc.binghamton.edu (bingnet2.cc.binghamton.edu [128.226.1.18]) by hub.freebsd.org (Postfix) with ESMTP id F35F737B405 for ; Wed, 24 Apr 2002 21:47:36 -0700 (PDT) Received: from onyx ([128.226.182.171]) by bingnet2.cc.binghamton.edu (8.11.6/8.11.6) with ESMTP id g3ONGNg25643 for ; Wed, 24 Apr 2002 19:16:23 -0400 (EDT) Date: Wed, 24 Apr 2002 19:16:22 -0400 (EDT) From: Zhihui Zhang X-Sender: zzhang@onyx To: freebsd-hackers@freebsd.org Subject: Is it a file system code bug? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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