public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: fstests@vger.kernel.org
Cc: Jan Kara <jack@suse.cz>
Subject: [PATCH] Fix fsx errors due to unsupported FIDEDUPERANGE
Date: Thu, 28 Mar 2019 11:51:19 +0100	[thread overview]
Message-ID: <20190328105119.31257-1-jack@suse.cz> (raw)

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

             reply	other threads:[~2019-03-28 10:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28 10:51 Jan Kara [this message]
2019-03-28 15:31 ` [PATCH] Fix fsx errors due to unsupported FIDEDUPERANGE Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190328105119.31257-1-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=fstests@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox