mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
xfs: always succeed when deduping zero bytes
It turns out that btrfs and xfs had differing interpretations of what to do when the dedupe length is zero. Change xfs to follow btrfs' semantics so that the userland interface is consistent. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
parent
cf7841c12d
commit
fba3e594ef
1 changed files with 7 additions and 1 deletions
|
@ -1317,8 +1317,14 @@ xfs_reflink_remap_range(
|
|||
goto out_unlock;
|
||||
}
|
||||
|
||||
if (len == 0)
|
||||
/* Zero length dedupe exits immediately; reflink goes to EOF. */
|
||||
if (len == 0) {
|
||||
if (is_dedupe) {
|
||||
ret = 0;
|
||||
goto out_unlock;
|
||||
}
|
||||
len = isize - pos_in;
|
||||
}
|
||||
|
||||
/* Ensure offsets don't wrap and the input is inside i_size */
|
||||
if (pos_in + len < pos_in || pos_out + len < pos_out ||
|
||||
|
|
Loading…
Add table
Reference in a new issue