From: Darrick J. Wong <darrick.wong@xxxxxxxxxx> The dedupe command should only complain about non-matching extents if the kernel hasn't managed to dedupe /any/ of the input range. Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> --- io/reflink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/io/reflink.c b/io/reflink.c index 26eb2e32..72dfe32d 100644 --- a/io/reflink.c +++ b/io/reflink.c @@ -70,7 +70,8 @@ dedupe_ioctl( _(strerror(-info->status))); goto done; } - if (info->status == XFS_EXTENT_DATA_DIFFERS) { + if (deduped == 0 && + info->status == XFS_EXTENT_DATA_DIFFERS) { fprintf(stderr, "XFS_IOC_FILE_EXTENT_SAME: %s\n", _("Extents did not match.")); goto done;