From: Jan Kara Date: Thu, 28 Mar 2019 10:51:19 +0000 (+0100) Subject: fsx: fix errors due to unsupported FIDEDUPERANGE X-Git-Tag: v2022.05.01~1207 X-Git-Url: http://git.apps.os.sepia.ceph.com/?p=xfstests-dev.git;a=commitdiff_plain;h=b591875529d13006c2b4e62dbc4b5726d8e2d77a 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 Reviewed-by: Darrick J. Wong Signed-off-by: Eryu Guan --- diff --git a/ltp/fsx.c b/ltp/fsx.c index f4a1c7cf..391824bf 100644 --- a/ltp/fsx.c +++ b/ltp/fsx.c @@ -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 "