public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix fsx errors due to unsupported FIDEDUPERANGE
@ 2019-03-28 10:51 Jan Kara
  2019-03-28 15:31 ` Darrick J. Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kara @ 2019-03-28 10:51 UTC (permalink / raw)
  To: fstests; +Cc: Jan Kara

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>
---
 ltp/fsx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ltp/fsx.c b/ltp/fsx.c
index f4a1c7cf820b..391824bfbc68 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.16.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-28 15:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-28 10:51 [PATCH] Fix fsx errors due to unsupported FIDEDUPERANGE Jan Kara
2019-03-28 15:31 ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox