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
This commit is contained in:
Alan Somers 2020-07-02 13:17:31 +00:00
parent a2de789ebb
commit f60b4812d8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=362891

View File

@ -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;