Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Jul 2020 13:17:32 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r362891 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <202007021317.062DHWKY099408@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: asomers
Date: Thu Jul  2 13:17:31 2020
New Revision: 362891
URL: https://svnweb.freebsd.org/changeset/base/362891

Log:
  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
  MFC after:	2 weeks
  Sponsored by:	Axcient
  Differential Revision:	https://reviews.freebsd.org/D25543

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c	Thu Jul  2 12:58:07 2020	(r362890)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c	Thu Jul  2 13:17:31 2020	(r362891)
@@ -1121,12 +1121,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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202007021317.062DHWKY099408>