aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/brt.c
diff options
context:
space:
mode:
authororomenahar <[email protected]>2023-08-08 18:37:06 +0200
committerBrian Behlendorf <[email protected]>2023-08-25 13:33:40 -0700
commit895cb689d310e49cc21040f565d63dd34cc60ab3 (patch)
tree3bfb4749b33afcd965560f671eed816e8e3374eb /module/zfs/brt.c
parent6bdc7259d1a3d8b1a48dfbd26e5d98f172e09bd9 (diff)
zfs_clone_range should return a descriptive error codes
Return the more descriptive error codes instead of `EXDEV` when the parameters don't match the requirements of the clone function. Updated the comments in `brt.c` accordingly. The first three errors are just invalid parameters, which zfs can not handle. The fourth error indicates that the block which should be cloned is created and cloned or modified in the same transaction group (`txg`). Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Rob Norris <[email protected]> Signed-off-by: Kay Pedersen <[email protected]> Closes #15148
Diffstat (limited to 'module/zfs/brt.c')
-rw-r--r--module/zfs/brt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/module/zfs/brt.c b/module/zfs/brt.c
index e8218fb26..ddd8eefe6 100644
--- a/module/zfs/brt.c
+++ b/module/zfs/brt.c
@@ -174,7 +174,7 @@
* size_t len, unsigned int flags);
*
* Even though offsets and length represent bytes, they have to be
- * block-aligned or we will return the EXDEV error so the upper layer can
+ * block-aligned or we will return an error so the upper layer can
* fallback to the generic mechanism that will just copy the data.
* Using copy_file_range(2) will call OS-independent zfs_clone_range() function.
* This function was implemented based on zfs_write(), but instead of writing
@@ -192,9 +192,9 @@
* Some special cases to consider and how we address them:
* - The block we want to clone may have been created within the same
* transaction group that we are trying to clone. Such block has no BP
- * allocated yet, so cannot be immediately cloned. We return EXDEV.
+ * allocated yet, so cannot be immediately cloned. We return EAGAIN.
* - The block we want to clone may have been modified within the same
- * transaction group. We return EXDEV.
+ * transaction group. We return EAGAIN.
* - A block may be cloned multiple times during one transaction group (that's
* why pending list is actually a tree and not an append-only list - this
* way we can figure out faster if this block is cloned for the first time