Author: asomers
Date: Fri Jul 24 17:45:06 2020
New Revision: 363484
URL: https://svnweb.freebsd.org/changeset/base/363484

Log:
  MFC r362891:
  
  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.
  
  PR:           247668
  Reviewed by:  avg
  Sponsored by: Axcient
  Differential Revision:        https://reviews.freebsd.org/D25543

Modified:
  stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==============================================================================
--- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c       
Fri Jul 24 17:34:44 2020        (r363483)
+++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c       
Fri Jul 24 17:45:06 2020        (r363484)
@@ -1120,12 +1120,13 @@ zfsctl_snapdir_getattr(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;
        sfs_node_t *node = vp->v_data;
        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;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to