aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <[email protected]>2023-05-03 00:24:47 -0700
committerBrian Behlendorf <[email protected]>2023-05-11 16:07:02 -0700
commitb6d7370b9de5ebc7aae8ada702c3d05b81d28d77 (patch)
treef82c761e22e07631ee02f37fdc04833e3ae7e66e /module/zfs
parentd0d91f185efd9149d8faceb89a9a0e5e54093fc8 (diff)
Don't call zfs_exit_two() before zfs_enter_two().
Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Pawel Jakub Dawidek <[email protected]> Closes #14825
Diffstat (limited to 'module/zfs')
-rw-r--r--module/zfs/zfs_vnops.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c
index dca76227a..86706469a 100644
--- a/module/zfs/zfs_vnops.c
+++ b/module/zfs/zfs_vnops.c
@@ -1072,6 +1072,15 @@ zfs_clone_range(znode_t *inzp, uint64_t *inoffp, znode_t *outzp,
inzfsvfs = ZTOZSB(inzp);
outzfsvfs = ZTOZSB(outzp);
+
+ /*
+ * We need to call zfs_enter() potentially on two different datasets,
+ * so we need a dedicated function for that.
+ */
+ error = zfs_enter_two(inzfsvfs, outzfsvfs, FTAG);
+ if (error != 0)
+ return (error);
+
inos = inzfsvfs->z_os;
outos = outzfsvfs->z_os;
@@ -1083,14 +1092,6 @@ zfs_clone_range(znode_t *inzp, uint64_t *inoffp, znode_t *outzp,
return (SET_ERROR(EXDEV));
}
- /*
- * We need to call zfs_enter() potentially on two different datasets,
- * so we need a dedicated function for that.
- */
- error = zfs_enter_two(inzfsvfs, outzfsvfs, FTAG);
- if (error != 0)
- return (error);
-
ASSERT(!outzfsvfs->z_replay);
error = zfs_verify_zp(inzp);