From owner-freebsd-fs@FreeBSD.ORG Tue Mar 2 11:08:44 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2579C16A4CE for ; Tue, 2 Mar 2004 11:08:44 -0800 (PST) Received: from mx.nsu.ru (mx.nsu.ru [212.192.164.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id C685B43D39 for ; Tue, 2 Mar 2004 11:08:43 -0800 (PST) (envelope-from fjoe@iclub.nsu.ru) Received: from iclub.nsu.ru ([193.124.215.97] ident=root) by mx.nsu.ru with esmtp (Exim 4.30) id 1AyFIC-0002Ts-Tf; Wed, 03 Mar 2004 01:11:00 +0600 Received: from iclub.nsu.ru (fjoe@localhost [127.0.0.1]) by iclub.nsu.ru (8.12.10/8.12.10) with ESMTP id i22J8fYw039729; Wed, 3 Mar 2004 01:08:41 +0600 (NS) (envelope-from fjoe@iclub.nsu.ru) Received: (from fjoe@localhost) by iclub.nsu.ru (8.12.10/8.12.10/Submit) id i22J8ddS039728; Wed, 3 Mar 2004 01:08:39 +0600 (NS) (envelope-from fjoe) Date: Wed, 3 Mar 2004 01:08:38 +0600 From: Max Khon To: rjshang Message-ID: <20040302190838.GB38981@iclub.nsu.ru> References: <20040213091617.M29405@synology.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040213091617.M29405@synology.com> User-Agent: Mutt/1.4.1i cc: freebsd-fs@freebsd.org Subject: Re: Is that a typo in ffs_softdep.c X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2004 19:08:44 -0000 Hello! On Fri, Feb 13, 2004 at 05:16:17PM +0800, rjshang wrote: > It looks like a typo in ffs_softdep.c softdep_sync_metadata(). > The second parameter of drain_output is used to tell if it is > protected by &lk. > Is there other concern? > Please check the following patch from 4.9 release. > > --- ffs_softdep.c Wed Feb 6 02:46:53 2002 > +++ ffs_softdep.new.c Fri Feb 13 16:48:52 2004 > @@ -4299,29 +4299,29 @@ > return (0); > } > > FREE_LOCK(&lk); > /* > * If we are trying to sync a block device, some of its buffers may > * contain metadata that cannot be written until the contents of > some > * partially written files have been written to disk. The only easy > * way to accomplish this is to sync the entire filesystem (luckily > * this happens rarely). > * > * We must wait for any I/O in progress to finish so that > * all potential buffers on the dirty list will be visible. > */ > - drain_output(vp, 1); > + drain_output(vp, 0); > if (vn_isdisk(vp, NULL) && > vp->v_specmountpoint && !VOP_ISLOCKED(vp, NULL) && > (error = VFS_SYNC(vp->v_specmountpoint, MNT_WAIT, ap->a_cred, > ap->a_p)) != 0) > return (error); > return (0); > } > > /* > * Flush the dependencies associated with an inodedep. > * Called with splbio blocked. > */ > static int > flush_inodedep_deps(fs, ino) Nice catch! drain_output() should be called earlier (before chechkig dirty list). The bug was introduced in ffs_softdep.c rev. 1.57.2.10. Correct patch is attached. I sent this patch to Kirk for review and will commit it as soon as I get an approval from him. /fjoe