summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Macy <[email protected]>2020-08-01 08:42:55 -0700
committerGitHub <[email protected]>2020-08-01 08:42:55 -0700
commitfe628bc21d360336307d1da09bc9260a46dde444 (patch)
tree7a6f5171d4cf478341e15b3df3092323348ae925
parent8fb79fdddb076036a006e19f4e1b93b3baf72498 (diff)
Fix page fault in zfsctl_snapdir_getattr
Must acquire the z_teardown_lock before accessing the zfsvfs_t object. I can't reproduce this panic on demand, but this looks like the correct solution. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Authored-by: asomers <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10656
-rw-r--r--module/os/freebsd/zfs/zfs_ctldir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/module/os/freebsd/zfs/zfs_ctldir.c b/module/os/freebsd/zfs/zfs_ctldir.c
index 8481a9d75..0fe32b195 100644
--- a/module/os/freebsd/zfs/zfs_ctldir.c
+++ b/module/os/freebsd/zfs/zfs_ctldir.c
@@ -1088,11 +1088,12 @@ zfsctl_snapdir_getattr(struct vop_getattr_args *ap)
vnode_t *vp = ap->a_vp;
vattr_t *vap = ap->a_vap;
zfsvfs_t *zfsvfs = vp->v_vfsp->vfs_data;
- dsl_dataset_t *ds = dmu_objset_ds(zfsvfs->z_os);
+ dsl_dataset_t *ds;
uint64_t snap_count;
int err;
ZFS_ENTER(zfsvfs);
+ ds = dmu_objset_ds(zfsvfs->z_os);
zfsctl_common_getattr(vp, vap);
vap->va_ctime = dmu_objset_snap_cmtime(zfsvfs->z_os);
vap->va_mtime = vap->va_ctime;