summaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>1999-03-09 00:17:06 +0000
committerArtur Grabowski <art@cvs.openbsd.org>1999-03-09 00:17:06 +0000
commit73073e846d1933f40f5bf3111030e9fa879604aa (patch)
tree4040172a292b74e18c845dd741dadd3d0528b825 /sys/ufs
parent53105b08943704bef27540b6d66cd96e849675fa (diff)
workaround deadlocks in the unmount/kill mount_mfs race.
XXX - This is wrong. I have to rethink this/rewrite mfs.
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/mfs/mfs_vfsops.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/ufs/mfs/mfs_vfsops.c b/sys/ufs/mfs/mfs_vfsops.c
index 7361f846c4c..831715431f9 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.6 1998/02/08 22:41:52 tholo Exp $ */
+/* $OpenBSD: mfs_vfsops.c,v 1.7 1999/03/09 00:17:05 art Exp $ */
/* $NetBSD: mfs_vfsops.c,v 1.10 1996/02/09 22:31:28 christos Exp $ */
/*
@@ -270,9 +270,18 @@ 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) &&
- dounmount(mp, 0, p) != 0)
- CLRSIG(p, CURSIG(p));
+ if (tsleep((caddr_t)vp, mfs_pri, "mfsidl", 0)) {
+ /*
+ * Don't attempt to unmount when MNT_UNMOUNT is set,
+ * that means that someone is waiting for us to
+ * finish our operations and it also means that
+ * we will sleep until he is finished. deadlock.
+ * XXX - there is a multiprocessor race here.
+ */
+ if ((mp->mnt_flag & MNT_UNMOUNT) ||
+ dounmount(mp, 0, p) != 0)
+ CLRSIG(p, CURSIG(p));
+ }
}
return (0);
}