Skip to content

Commit 4a57a84

Browse files
Ansgar Lößertorvalds
Ansgar Lößer
authored andcommitted
vf/remap: return the amount of bytes actually deduplicated
When using the FIDEDUPRANGE ioctl, in case of success the requested size is returned. In some cases this might not be the actual amount of bytes deduplicated. This change modifies vfs_dedupe_file_range() to report the actual amount of bytes deduplicated, instead of the requested amount. Link: https://lore.kernel.org/linux-fsdevel/[email protected]/ Reported-by: Ansgar Lößer <[email protected]> Reported-by: Max Schlecht <[email protected]> Reported-by: Björn Scheuermann <[email protected]> Cc: Dave Chinner <[email protected]> Cc: Darrick J Wong <[email protected]> Signed-off-by: Ansgar Lößer <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent d0b97f3 commit 4a57a84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/remap_range.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ int vfs_dedupe_file_range(struct file *file, struct file_dedupe_range *same)
547547
else if (deduped < 0)
548548
info->status = deduped;
549549
else
550-
info->bytes_deduped = len;
550+
info->bytes_deduped = deduped;
551551

552552
next_fdput:
553553
fdput(dst_fd);

0 commit comments

Comments
 (0)