diff options
author | avg <avg@FreeBSD.org> | 2016-05-16 06:24:04 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2016-05-16 06:24:04 +0000 |
commit | c6df178a61cdcf0f4f406f6b4f4b67991ba37dd3 (patch) | |
tree | bda07794a4927e98910937645ace0a25c1e1a435 /sys/cddl/compat/opensolaris | |
parent | c9b8fe736214461802a648e4515da7b498d02d37 (diff) | |
download | FreeBSD-src-c6df178a61cdcf0f4f406f6b4f4b67991ba37dd3.zip FreeBSD-src-c6df178a61cdcf0f4f406f6b4f4b67991ba37dd3.tar.gz |
zfsctl: fix several problems with reference counts
* Remove excessive references on a snapshot mountpoint vnode.
zfsctl_snapdir_lookup() called VN_HOLD() on a vnode returned from
zfsctl_snapshot_mknode() and the latter also had a call to VN_HOLD()
on the same vnode.
On top of that gfs_dir_create() already returns the vnode with the
use count of 1 (set in getnewvnode).
So there was 3 references on the vnode.
* mount_snapshot() should keep a reference to a covered vnode.
That reference is owned by the mountpoint (mounted snapshot filesystem).
* Remove cryptic manipulations of a covered vnode in zfs_umount().
FreeBSD dounmount() already does the right thing and releases the covered
vnode.
PR: 207464
Reported by: dustinwenz@ebureau.com
Tested by: Howard Powell <hpowell@lighthouseinstruments.com>
MFC after: 3 weeks
Diffstat (limited to 'sys/cddl/compat/opensolaris')
-rw-r--r-- | sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c b/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c index 49becbc..03e8e5f 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c @@ -229,7 +229,7 @@ mount_snapshot(kthread_t *td, vnode_t **vpp, const char *fstype, char *fspath, vfs_event_signal(NULL, VQ_MOUNT, 0); if (VFS_ROOT(mp, LK_EXCLUSIVE, &mvp)) panic("mount: lost mount"); - vput(vp); + VOP_UNLOCK(vp, 0); vfs_unbusy(mp); *vpp = mvp; return (0); |