From 58567a1b4ea2125c75587cfc1ac7c39e4007d302 Mon Sep 17 00:00:00 2001 From: Will Andrews Date: Sat, 23 Mar 2013 16:34:56 +0000 Subject: [PATCH] ZFS: Fix a panic while unmounting a busy filesystem. This particular scenario was easily reproduced using a NFS export. When the first 'zfs unmount' occurred, it returned EBUSY via this path, while vflush() had flushed references on the filesystem's root vnode, which in turn caused its v_interlock to be destroyed. The next time 'zfs unmount' was called, vflush() tried to obtain this lock, which caused this panic. Since vflush() on FreeBSD is a definitive call, there is no need to check vfsp->vfs_count after it completes. Simply #ifdef sun this check. Submitted by: avg Reviewed by: avg Approved by: ken (mentor) MFC after: 1 month --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c index 1fb323370bf2..357b8ec4d938 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c @@ -1968,6 +1968,7 @@ zfs_umount(vfs_t *vfsp, int fflag) return (ret); } +#ifdef sun if (!(fflag & MS_FORCE)) { /* * Check the number of active vnodes in the file system. @@ -1988,6 +1989,7 @@ zfs_umount(vfs_t *vfsp, int fflag) return (EBUSY); } } +#endif VERIFY(zfsvfs_teardown(zfsvfs, B_TRUE) == 0); os = zfsvfs->z_os;