diff options
author | attilio <attilio@FreeBSD.org> | 2008-01-07 16:51:24 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2008-01-07 16:51:24 +0000 |
commit | be66714153ff43a4cecc10d124a27bca79a9dfa0 (patch) | |
tree | 38f38420bd092b6035fc739230cc80b2f2ac1480 | |
parent | e828cf6934bf52bac2b31a3a544c1ee03c79843b (diff) | |
download | FreeBSD-src-be66714153ff43a4cecc10d124a27bca79a9dfa0.zip FreeBSD-src-be66714153ff43a4cecc10d124a27bca79a9dfa0.tar.gz |
g_vfs_close() wants the sx topology lock held while executing, so just
add correct locking to the operation of unmounting.
This will prevent debugging kernels from panicking if mounting a
non-hpfs partition (I'm not sure if this can be a problem with a
successful mounting operation though).
MFC: 3 days
-rw-r--r-- | sys/fs/hpfs/hpfs_vfsops.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/fs/hpfs/hpfs_vfsops.c b/sys/fs/hpfs/hpfs_vfsops.c index 5d55356..2ef7dc6 100644 --- a/sys/fs/hpfs/hpfs_vfsops.c +++ b/sys/fs/hpfs/hpfs_vfsops.c @@ -323,7 +323,11 @@ failed: if (bp) brelse (bp); mp->mnt_data = NULL; + DROP_GIANT(); + g_topology_lock(); g_vfs_close(cp, td); + g_topology_unlock(); + PICKUP_GIANT(); return (error); } @@ -353,7 +357,11 @@ hpfs_unmount( } vinvalbuf(hpmp->hpm_devvp, V_SAVE, td, 0, 0); + DROP_GIANT(); + g_topology_lock(); g_vfs_close(hpmp->hpm_cp, td); + g_topology_unlock(); + PICKUP_GIANT(); vrele(hpmp->hpm_devvp); dprintf(("hpfs_umount: freeing memory...\n")); |