aboutsummaryrefslogtreecommitdiff
path: root/sys/cddl/contrib/opensolaris
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2018-10-14 16:14:01 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2018-10-14 16:14:01 +0000
commitbca84f54ce6ff22f7a14a7bb6370bd45fcd57e3b (patch)
treefffc1f723e1af3354a27554d0701a35f2f9d7a3c /sys/cddl/contrib/opensolaris
parentadf93b56dc59e43a2a953f2809a5120e0c39610e (diff)
downloadsrc-bca84f54ce6ff22f7a14a7bb6370bd45fcd57e3b.tar.gz
src-bca84f54ce6ff22f7a14a7bb6370bd45fcd57e3b.zip
zfs: fix a panic after failed mount
r338927("zfs: depessimize zfs_root with rmlocks") failed to error check the mount before caching root vnode. Results in crashes in rrw_enter_read_impl tracing back to zfs_mount. Reported by: Mike Tancsa Tested by: allanjude Approved by: re (kib)
Notes
Notes: svn path=/head/; revision=339355
Diffstat (limited to 'sys/cddl/contrib/opensolaris')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c3
1 files changed, 2 insertions, 1 deletions
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 1ab51ba77a1f..b372e9734aa5 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
@@ -1929,7 +1929,8 @@ zfs_mount(vfs_t *vfsp)
error = zfs_domount(vfsp, osname);
PICKUP_GIANT();
- zfs_root_setvnode((zfsvfs_t *)vfsp->vfs_data);
+ if (error == 0)
+ zfs_root_setvnode((zfsvfs_t *)vfsp->vfs_data);
#ifdef illumos
/*