From cbc785c2938ea79fd630f46586873985fe476327 Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Thu, 14 Sep 2017 08:47:06 +0000 Subject: dounmount: do not release the mount point's reference on the covered vnode As long as mnt_ref is not zero there can be a consumer that might try to access mnt_vnodecovered. For this reason the covered vnode must not be freed until mnt_ref goes to zero. So, move the release of the covered vnode to vfs_mount_destroy. Reviewed by: kib MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D12329 --- sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sys/cddl') diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c b/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c index d33b034a4d61..894675ac91a5 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c @@ -209,6 +209,7 @@ mount_snapshot(kthread_t *td, vnode_t **vpp, const char *fstype, char *fspath, vput(vp); vfs_unbusy(mp); vfs_freeopts(mp->mnt_optnew); + mp->mnt_vnodecovered = NULL; vfs_mount_destroy(mp); return (error); } -- cgit v1.2.3