Commit fba3e594 authored by Darrick J. Wong's avatar Darrick J. Wong Committed by Dave Chinner

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: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent cf7841c1
...@@ -1317,8 +1317,14 @@ xfs_reflink_remap_range( ...@@ -1317,8 +1317,14 @@ xfs_reflink_remap_range(
goto out_unlock; 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; len = isize - pos_in;
}
/* Ensure offsets don't wrap and the input is inside i_size */ /* Ensure offsets don't wrap and the input is inside i_size */
if (pos_in + len < pos_in || pos_out + len < pos_out || if (pos_in + len < pos_in || pos_out + len < pos_out ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment