FreeBSD Bugzilla – Attachment 170652 Details for
Bug 209158
node / npm triggering zfs rename deadlock
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
delta patch
file_209158.txt (text/plain), 1.81 KB, created by
Andriy Gapon
on 2016-05-25 13:08:03 UTC
(
hide
)
Description:
delta patch
Filename:
MIME Type:
Creator:
Andriy Gapon
Created:
2016-05-25 13:08:03 UTC
Size:
1.81 KB
patch
obsolete
>commit 814ab0cd80d97b09c2a5900659c855fe94f74d3d >Author: Andriy Gapon <avg@icyb.net.ua> >Date: Wed May 25 15:17:54 2016 +0300 > > zfs_rename: fix a few problems > > - ZFS_VERIFY_ZP can not be used before ZFS_ENTER because it calls ZFS_EXIT > - ZFS_VERIFY_ZP can not be used here it at all because it can return > bypassing all the cleanup code > - likewise, we should not bypass the cleanup code is sdzp is invalid > > Also, add some comments to the code. > >diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c >index 851518092424e..8ef1ffc64004d 100644 >--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c >+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c >@@ -3523,25 +3523,31 @@ zfs_rename(vnode_t *sdvp, vnode_t **svpp, struct componentname *scnp, > int error = 0; > > tdzp = VTOZ(tdvp); >- ZFS_VERIFY_ZP(tdzp); > zfsvfs = tdzp->z_zfsvfs; >- ZFS_ENTER(zfsvfs); > zilog = zfsvfs->z_log; >- sdzp = VTOZ(sdvp); >+ ZFS_ENTER(zfsvfs); > >+ /* >+ * We can not use ZFS_VERIFY_ZP() here because it could directly return >+ * bypassing the cleanup code in the case of an error. >+ */ >+ if (tdzp->z_sa_hdl == NULL) { >+ error = SET_ERROR(EIO); >+ goto out; >+ } >+ >+ /* Reject renames across filesystems. */ > if ((*svpp)->v_mount != tdvp->v_mount || > ((*tvpp) != NULL && (*svpp)->v_mount != (*tvpp)->v_mount)) { > error = SET_ERROR(EXDEV); > goto out; > } > >- /* >- * In case sdzp is not valid, let's be sure to exit from the right >- * zfsvfs_t. >- */ >+ /* ZFS_VERIFY_ZP() can't be used here too. */ >+ sdzp = VTOZ(sdvp); > if (sdzp->z_sa_hdl == NULL) { >- ZFS_EXIT(zfsvfs); >- return (SET_ERROR(EIO)); >+ error = SET_ERROR(EIO); >+ goto out; > } > > if (zfsctl_is_node(tdvp)) {
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 209158
:
170634
|
170652