public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Chandan Rajendra <chandan@linux.vnet.ibm.com>
To: fstests@vger.kernel.org
Cc: Chandan Rajendra <chandan@linux.vnet.ibm.com>, eguan@redhat.com
Subject: [PATCH] Fix fcollapse require code to work with 64k block size
Date: Thu, 22 Feb 2018 11:28:55 +0530	[thread overview]
Message-ID: <20180222055855.3008-1-chandan@linux.vnet.ibm.com> (raw)

For 64k block size, the require code fails because the block range [4k,
12k] would cause the fcollapse syscall to return -EINVAL. Hence the
tests using them are not executed.

This commit fixes the issue by calculating file offset ranges based on
the block size of the underlying filesystem.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
---
 common/rc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/common/rc b/common/rc
index a6caca9..04a2187 100644
--- a/common/rc
+++ b/common/rc
@@ -2106,8 +2106,10 @@ _require_xfs_io_command()
 		param_checked=1
 		;;
 	"fpunch" | "fcollapse" | "zero" | "fzero" | "finsert" | "funshare")
-		testio=`$XFS_IO_PROG -F -f -c "pwrite 0 20k" -c "fsync" \
-			-c "$command 4k 8k" $testfile 2>&1`
+		blocksize=$(_get_block_size $TEST_DIR/)
+		testio=`$XFS_IO_PROG -F -f -c "pwrite 0 $((5 * $blocksize))" \
+			-c "fsync" -c "$command $blocksize $((2 * $blocksize))" \
+			$testfile 2>&1`
 		;;
 	"fiemap")
 		# If 'ranged' is passed as argument then we check to see if fiemap supports
-- 
2.9.5


                 reply	other threads:[~2018-02-22  5:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20180222055855.3008-1-chandan@linux.vnet.ibm.com \
    --to=chandan@linux.vnet.ibm.com \
    --cc=eguan@redhat.com \
    --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