From 12d45204b3298ad0d91b106713e9500f7b9cd287 Mon Sep 17 00:00:00 2001 From: Eric Jackson Date: Mon, 18 Feb 2002 09:23:27 +0000 Subject: fix possible panic on reboot for mfs mounted fs. fix from NetBSD pr#1693 art@ OK --- sys/ufs/mfs/mfs_vfsops.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/ufs/mfs/mfs_vfsops.c b/sys/ufs/mfs/mfs_vfsops.c index aed5baf5a34..63259f5408e 100644 --- a/sys/ufs/mfs/mfs_vfsops.c +++ b/sys/ufs/mfs/mfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfs_vfsops.c,v 1.16 2002/01/23 01:40:59 art Exp $ */ +/* $OpenBSD: mfs_vfsops.c,v 1.17 2002/02/18 09:23:26 ericj Exp $ */ /* $NetBSD: mfs_vfsops.c,v 1.10 1996/02/09 22:31:28 christos Exp $ */ /* @@ -259,6 +259,7 @@ mfs_start(mp, flags, p) register struct mfsnode *mfsp = VTOMFS(vp); register struct buf *bp; register caddr_t base; + int sleepreturn = 0; base = mfsp->mfs_baseoff; while (mfsp->mfs_buflist != (struct buf *)-1) { @@ -275,11 +276,14 @@ mfs_start(mp, flags, p) * otherwise we will loop here, as tsleep will always return * EINTR/ERESTART. */ - if (tsleep((caddr_t)vp, mfs_pri, "mfsidl", 0)) { + if (sleepreturn != 0) { if (vfs_busy(mp, LK_NOWAIT, NULL, p) || dounmount(mp, 0, p)) CLRSIG(p, CURSIG(p)); + sleepreturn = 0; + continue; } + sleepreturn = tsleep((caddr_t)vp, mfs_pri, "mfsidl", 0); } return (0); } -- cgit v1.2.3