fsx: fix errors due to unsupported FIDEDUPERANGE

Older kernels (prior commit 494633fac7896 "vfs: vfs_dedupe_file_range()
doesn't return EOPNOTSUPP") will return EINVAL when operation is not
supported. Make fsx treat this error as a sign of unsupported
deduplication as well to make it usable with these older kernels.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Jan Kara
2019-03-28 11:51:19 +01:00
committed by Eryu Guan
parent b0ef2879a7
commit b591875529
+2 -1
View File
@@ -1482,7 +1482,8 @@ test_dedupe_range(void)
else
error = 0;
if (error == EOPNOTSUPP || error == ENOTTY) {
/* Older kernels may return EINVAL... */
if (error == EOPNOTSUPP || error == ENOTTY || error == EINVAL) {
if (!quiet)
fprintf(stderr,
"main: filesystem does not support "