diff options
author | 1999-03-09 00:17:05 +0000 | |
---|---|---|
committer | 1999-03-09 00:17:05 +0000 | |
commit | 15ec14ce748ed4f9109c5d15926ef6730a609e18 (patch) | |
tree | 64c89edba2955ba0a0f425aa4d1f15304ef8fa7e | |
parent | reference docs (diff) | |
download | wireguard-openbsd-15ec14ce748ed4f9109c5d15926ef6730a609e18.tar.xz wireguard-openbsd-15ec14ce748ed4f9109c5d15926ef6730a609e18.zip |
workaround deadlocks in the unmount/kill mount_mfs race.
XXX - This is wrong. I have to rethink this/rewrite mfs.
-rw-r--r-- | sys/ufs/mfs/mfs_vfsops.c | 17 |
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); } |