Date: Mon, 5 Aug 2002 22:41:53 +0200 From: Pierre Beyssac <pb@fasterix.frmug.org> To: Bruce Evans <bde@zeta.org.au> Cc: freebsd-current@FreeBSD.ORG Subject: Re: deadlock in fs/msdosfs/msdosfs_vnops.c:msdosfs_fsync() Message-ID: <20020805224153.A564@fasterix.frmug.org> In-Reply-To: <20020805221247.A78878@fasterix.frmug.org>; from pb@fasterix.frmug.org on Mon, Aug 05, 2002 at 10:12:47PM %2B0200 References: <20020805104153.A37733@bofh.enst.fr> <20020805203323.M17317-100000@gamplex.bde.org> <20020805221247.A78878@fasterix.frmug.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <stdio.h>
#include <fcntl.h>
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020805224153.A564>
