FreeBSD Bugzilla – Attachment 170172 Details for
Bug 207464
Panic when destroying ZFS snapshot
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch for testing
zfsctl-snapshot-refcount.patch (text/plain), 2.66 KB, created by
Andriy Gapon
on 2016-05-10 09:37:06 UTC
(
hide
)
Description:
proposed patch for testing
Filename:
MIME Type:
Creator:
Andriy Gapon
Created:
2016-05-10 09:37:06 UTC
Size:
2.66 KB
patch
obsolete
>zfsctl: fix several problems with reference counts > >* Remove excessive references on a snapshot 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). > >* mount_snapshot() should keep a reference on a covered snapshot 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. > >diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c >index 3ac811a9be583..f4130e1576551 100644 >--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c >+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c >@@ -1113,7 +1113,6 @@ zfsctl_snapdir_lookup(ap) > sep->se_name = kmem_alloc(strlen(nm) + 1, KM_SLEEP); > (void) strcpy(sep->se_name, nm); > *vpp = sep->se_root = zfsctl_snapshot_mknode(dvp, dmu_objset_id(snap)); >- VN_HOLD(*vpp); > avl_insert(&sdp->sd_snaps, sep, where); > > dmu_objset_rele(snap, FTAG); >@@ -1490,7 +1489,6 @@ zfsctl_snapshot_mknode(vnode_t *pvp, uint64_t objset) > > vp = gfs_dir_create(sizeof (zfsctl_node_t), pvp, pvp->v_vfsp, > &zfsctl_ops_snapshot, NULL, NULL, MAXNAMELEN, NULL, NULL); >- VN_HOLD(vp); > zcp = vp->v_data; > zcp->zc_id = objset; > VOP_UNLOCK(vp, 0); >diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c b/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c >index a2532f80222ec..a2ce66a207f96 100644 >--- a/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c >+++ b/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c >@@ -228,7 +228,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); >diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c >index 932b61a31ee9e..42629621ab6cd 100644 >--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c >+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c >@@ -2005,12 +2005,6 @@ zfs_umount(vfs_t *vfsp, int fflag) > */ > if (zfsvfs->z_ctldir != NULL) > zfsctl_destroy(zfsvfs); >- if (zfsvfs->z_issnap) { >- vnode_t *svp = vfsp->mnt_vnodecovered; >- >- if (svp->v_count >= 2) >- VN_RELE(svp); >- } > zfs_freevfs(vfsp); > > return (0);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 207464
:
169495
|
170024
| 170172 |
170343