提交 4a57a840 编写于 作者: A Ansgar Lößer 提交者: Linus Torvalds

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/5548ef63-62f9-4f46-5793-03165ceccacc@tu-darmstadt.de/Reported-by: NAnsgar Lößer <ansgar.loesser@kom.tu-darmstadt.de>
Reported-by: NMax Schlecht <max.schlecht@informatik.hu-berlin.de>
Reported-by: NBjörn Scheuermann <scheuermann@kom.tu-darmstadt.de>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Darrick J Wong <djwong@kernel.org>
Signed-off-by: NAnsgar Lößer <ansgar.loesser@kom.tu-darmstadt.de>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 d0b97f38
...@@ -547,7 +547,7 @@ int vfs_dedupe_file_range(struct file *file, struct file_dedupe_range *same) ...@@ -547,7 +547,7 @@ int vfs_dedupe_file_range(struct file *file, struct file_dedupe_range *same)
else if (deduped < 0) else if (deduped < 0)
info->status = deduped; info->status = deduped;
else else
info->bytes_deduped = len; info->bytes_deduped = deduped;
next_fdput: next_fdput:
fdput(dst_fd); fdput(dst_fd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册