Skip to content

Commit fe628bc

Browse files
authored
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
1 parent 8fb79fd commit fe628bc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

module/os/freebsd/zfs/zfs_ctldir.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,11 +1088,12 @@ zfsctl_snapdir_getattr(struct vop_getattr_args *ap)
10881088
vnode_t *vp = ap->a_vp;
10891089
vattr_t *vap = ap->a_vap;
10901090
zfsvfs_t *zfsvfs = vp->v_vfsp->vfs_data;
1091-
dsl_dataset_t *ds = dmu_objset_ds(zfsvfs->z_os);
1091+
dsl_dataset_t *ds;
10921092
uint64_t snap_count;
10931093
int err;
10941094

10951095
ZFS_ENTER(zfsvfs);
1096+
ds = dmu_objset_ds(zfsvfs->z_os);
10961097
zfsctl_common_getattr(vp, vap);
10971098
vap->va_ctime = dmu_objset_snap_cmtime(zfsvfs->z_os);
10981099
vap->va_mtime = vap->va_ctime;

0 commit comments

Comments
 (0)