From b591875529d13006c2b4e62dbc4b5726d8e2d77a Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Thu, 28 Mar 2019 11:51:19 +0100 Subject: [PATCH] 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 --- ltp/fsx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 " -- 2.39.5