From owner-cvs-all@FreeBSD.ORG Fri Jun 20 21:58:17 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1D5CB37B401; Fri, 20 Jun 2003 21:58:17 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2DA8943F3F; Fri, 20 Jun 2003 21:58:15 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id OAA21461; Sat, 21 Jun 2003 14:58:11 +1000 Date: Sat, 21 Jun 2003 14:58:10 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: "Tim J. Robbins" In-Reply-To: <200306201452.h5KEqqh3054891@repoman.freebsd.org> Message-ID: <20030621135027.G51140@gamplex.bde.org> References: <200306201452.h5KEqqh3054891@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/fs/ntfs ntfs_subr.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jun 2003 04:58:17 -0000 On Fri, 20 Jun 2003, Tim J. Robbins wrote: > tjr 2003/06/20 07:52:52 PDT > > FreeBSD src repository > > Modified files: > sys/fs/ntfs ntfs_subr.c > Log: > Merge from NetBSD src/sys/ntfs/ntfs_subr.c 1.5 & 1.30 (jdolecek): > - Avoid calling bread() with different sizes on the same blkno. > Although the buffer cache is designed to handle differing size > buffers, it erroneously tries to write the incorrectly-sized buffer > buffer back to disk before reading the correctly-sized one, even > when it's not dirty. This behaviour caused a panic for read-only > NTFS mounts when INVARIANTS was enabled ("bundirty: buffer x still > on queue y"), reported by NAKAJI Hiroyuki. Maybe the buffer cache is designed to handle differing size buffers in NetBSD, but in FreeBSD I believe it is fundamentally incompatible with differing size buffers except when the buffers don't overlap. The special case of overlap where the buffers have the same blkno could be handled relatively easily, but apparently isn't. The general case would involve searching for all overlapping buffers and updating their states coherently whenever a buffer is changed. msdosfs used to have problems related to this. For msdosfs, data blocks (clusters) have different sizes than some metadata blocks (BPB, FATs and root directory) and are not aligned to cluster_size boundaries, so it is easy for metadata buffers to overlap data buffers. IIRC, the fix involved making vfs_bio more aware of overlapping (or just partially valid?) buffers. msdosfs still does careless things like bread() with a size of 2048 to read the boot "sector" and not invalidating the buffer for this before reading other blocks. Bruce