Skip to content

Commit

Permalink
vf/remap: return the amount of bytes actually deduplicated
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Ansgar Lößer authored and torvalds committed Jul 13, 2022
1 parent d0b97f3 commit 4a57a84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/remap_range.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ int vfs_dedupe_file_range(struct file *file, struct file_dedupe_range *same)
else if (deduped < 0)
info->status = deduped;
else
info->bytes_deduped = len;
info->bytes_deduped = deduped;

next_fdput:
fdput(dst_fd);
Expand Down

0 comments on commit 4a57a84

Please sign in to comment.