aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/brt.c
diff options
context:
space:
mode:
authororomenahar <[email protected]>2023-08-08 18:37:06 +0200
committerGitHub <[email protected]>2023-08-08 09:37:06 -0700
commit019dea0a558517bf327d2c52e84a3a4b01eaaeb8 (patch)
tree1e31c5789d0cce81af57fc9dce9e17edbac9a0f3 /module/zfs/brt.c
parent683edb32b73885d1718a2220fe08c4cd61e63fd1 (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