From owner-freebsd-current Mon Aug 5 13:42: 0 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1423237B400 for ; Mon, 5 Aug 2002 13:41:58 -0700 (PDT) Received: from fasterix.frmug.org (fasterix.frmug.org [137.194.36.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2C34543E3B for ; Mon, 5 Aug 2002 13:41:57 -0700 (PDT) (envelope-from pb@fasterix.frmug.org) Received: from fasterix.frmug.org (localhost [127.0.0.1]) by fasterix.frmug.org (8.12.5/8.12.5) with ESMTP id g75KfsKg000636 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 5 Aug 2002 22:41:55 +0200 (CEST) (envelope-from pb@fasterix.frmug.org) Received: (from pb@localhost) by fasterix.frmug.org (8.12.5/8.12.5/Submit) id g75KfrxG000635; Mon, 5 Aug 2002 22:41:53 +0200 (CEST) Date: Mon, 5 Aug 2002 22:41:53 +0200 From: Pierre Beyssac To: Bruce Evans Cc: freebsd-current@FreeBSD.ORG Subject: Re: deadlock in fs/msdosfs/msdosfs_vnops.c:msdosfs_fsync() Message-ID: <20020805224153.A564@fasterix.frmug.org> References: <20020805104153.A37733@bofh.enst.fr> <20020805203323.M17317-100000@gamplex.bde.org> <20020805221247.A78878@fasterix.frmug.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: <20020805221247.A78878@fasterix.frmug.org>; from pb@fasterix.frmug.org on Mon, Aug 05, 2002 at 10:12:47PM +0200 X-message-flag: Warning! Use of Microsoft Outlook is dangerous and makes your system susceptible to worms and viruses Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Well, I think I got it... --- msdosfs_vnops.c.orig Mon Aug 5 21:20:13 2002 +++ msdosfs_vnops.c Mon Aug 5 22:35:52 2002 @@ -830,7 +830,7 @@ goto loop; } while (vp->v_numoutput) { - vp->v_vflag |= VI_BWAIT; + vp->v_iflag |= VI_BWAIT; (void) msleep((caddr_t)&vp->v_numoutput, VI_MTX(vp), PRIBIO + 1, "msdosfsn", 0); } I'll commit that if nobody objects to it. Small test program, hangs everytime on a msdosfs without the above patch: #include #include int main() { char buf[512*1024]; int f; unsigned long l; f = open("testfile", O_CREAT|O_TRUNC|O_WRONLY, 644); if (f == -1) { perror("open"); exit(1); } l = write(f, buf, sizeof buf); if (l != sizeof buf) fprintf(stderr, "write error\n"); fsync(f); return 0; } -- Pierre Beyssac pb@fasterix.frmug.org pb@fasterix.freenix.org Free domains: http://www.eu.org/ or mail dns-manager@EU.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message