From owner-cvs-all@FreeBSD.ORG Sat Jun 21 02:35:26 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 9E32237B401; Sat, 21 Jun 2003 02:35:26 -0700 (PDT) Received: from smtp01.syd.iprimus.net.au (smtp01.syd.iprimus.net.au [210.50.30.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id D618143FAF; Sat, 21 Jun 2003 02:35:25 -0700 (PDT) (envelope-from tim@robbins.dropbear.id.au) Received: from dilbert.robbins.dropbear.id.au (203.134.129.103) by smtp01.syd.iprimus.net.au (7.0.015) id 3EED7FDA00222259; Sat, 21 Jun 2003 19:35:23 +1000 Received: by dilbert.robbins.dropbear.id.au (Postfix, from userid 1000) id 8A1C8C91F; Sat, 21 Jun 2003 19:35:10 +1000 (EST) Date: Sat, 21 Jun 2003 19:35:10 +1000 From: "Tim J. Robbins" To: Bruce Evans Message-ID: <20030621193510.A58194@dilbert.robbins.dropbear.id.au> References: <200306201452.h5KEqqh3054891@repoman.freebsd.org> <20030621135027.G51140@gamplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030621135027.G51140@gamplex.bde.org>; from bde@zeta.org.au on Sat, Jun 21, 2003 at 02:58:10PM +1000 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 09:35:27 -0000 On Sat, Jun 21, 2003 at 02:58:10PM +1000, Bruce Evans wrote: > 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. NetBSD's buffer cache definitely cannot handle requests for the same blkno with different sizes. jdolecek added that code to avoid requesting different sized buffers because NetBSD panics when it detects such a request; FreeBSD tries to handle the request correctly, but does a pretty bad job of it and issues the bogus write requests I mentioned in the commit message. I'm still trying to figure why it tries to write non-B_DELWRI buffers back to disk. It was added in revision 1.158, but the commit message is not very helpful in understanding exactly what kind of problems it was trying to fix. Tim