All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiao Yang <yangx.jy@cn.fujitsu.com>
To: <eguan@linux.alibaba.com>
Cc: <fstests@vger.kernel.org>, Xiao Yang <yangx.jy@cn.fujitsu.com>
Subject: [PATCH v2 2/2] fsx: Add '-a' option to skip unsupported keep size automatically
Date: Mon, 6 Jan 2020 15:06:54 +0800	[thread overview]
Message-ID: <20200106070654.13249-2-yangx.jy@cn.fujitsu.com> (raw)
In-Reply-To: <20200106070654.13249-1-yangx.jy@cn.fujitsu.com>

1) Use '-a' option to skip unsupported keep size automatically even if
   it's defined by --replay-ops.
2) Add $FSX_AVOID to tests which defines keep size by --replay-ops.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 ltp/fsx.c         | 9 +++++++--
 tests/generic/456 | 2 +-
 tests/generic/469 | 2 +-
 tests/generic/499 | 2 +-
 tests/generic/511 | 2 +-
 5 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/ltp/fsx.c b/ltp/fsx.c
index 11465e62..cde7df5c 100644
--- a/ltp/fsx.c
+++ b/ltp/fsx.c
@@ -163,6 +163,7 @@ int	seed = 1;			/* -S flag */
 int     mapped_writes = 1;              /* -W flag disables */
 int     fallocate_calls = 1;            /* -F flag disables */
 int     keep_size_calls = 1;            /* -K flag disables */
+int     skip_keep_size = 0;             /* -a flag skips unsupported keep_size automatically */
 int     punch_hole_calls = 1;           /* -H flag disables */
 int     zero_range_calls = 1;           /* -z flag disables */
 int	collapse_range_calls = 1;	/* -C flag disables */
@@ -2215,7 +2216,7 @@ void
 usage(void)
 {
 	fprintf(stdout, "usage: %s",
-		"fsx [-dknqxABEFJKLOWZ] [-b opnum] [-c Prob] [-g filldata] [-i logdev] [-j logid] [-l flen] [-m start:end] [-o oplen] [-p progressinterval] [-r readbdy] [-s style] [-t truncbdy] [-w writebdy] [-D startingop] [-N numops] [-P dirpath] [-S seed] fname\n\
+		"fsx [-adknqxABEFJKLOWZ] [-b opnum] [-c Prob] [-g filldata] [-i logdev] [-j logid] [-l flen] [-m start:end] [-o oplen] [-p progressinterval] [-r readbdy] [-s style] [-t truncbdy] [-w writebdy] [-D startingop] [-N numops] [-P dirpath] [-S seed] fname\n\
 	-b opnum: beginning operation number (default 1)\n\
 	-c P: 1 in P chance of file close+open at each op (default infinity)\n\
 	-d: debug output for all operations\n\
@@ -2268,6 +2269,7 @@ usage(void)
 #ifdef FALLOC_FL_KEEP_SIZE
 "	-K: Do not use keep size calls\n"
 #endif
+"	-a: Skip unsupported keep size automatically even if it's defined by --replay-ops\n"
 "	-L: fsxLite - no file creations & no file size changes\n\
 	-N numops: total # operations to do (default infinity)\n\
 	-O: use oplen (see -o flag) for every op (default random)\n\
@@ -2472,7 +2474,7 @@ main(int argc, char **argv)
 	setvbuf(stdout, (char *)0, _IOLBF, 0); /* line buffered stdout */
 
 	while ((ch = getopt_long(argc, argv,
-				 "b:c:dfg:i:j:kl:m:no:p:qr:s:t:w:xyABD:EFJKHzCILN:OP:RS:WXZ",
+				 "ab:c:dfg:i:j:kl:m:no:p:qr:s:t:w:xyABD:EFJKHzCILN:OP:RS:WXZ",
 				 longopts, NULL)) != EOF)
 		switch (ch) {
 		case 'b':
@@ -2590,6 +2592,9 @@ main(int argc, char **argv)
 		case 'K':
 			keep_size_calls = 0;
 			break;
+		case 'a':
+			skip_keep_size = 1;
+			break;
 		case 'H':
 			punch_hole_calls = 0;
 			break;
diff --git a/tests/generic/456 b/tests/generic/456
index 6124f0bb..0298c789 100755
--- a/tests/generic/456
+++ b/tests/generic/456
@@ -56,7 +56,7 @@ write 0x3e5ec 0x1a14 0x21446
 zero_range 0x20fac 0x6d9c 0x40000 keep_size
 mapwrite 0x216ad 0x274f 0x40000
 EOF
-run_check $here/ltp/fsx -d --replay-ops $fsxops $SCRATCH_MNT/testfile
+run_check $here/ltp/fsx -d --replay-ops $fsxops $FSX_AVOID $SCRATCH_MNT/testfile
 
 _flakey_drop_and_remount
 _unmount_flakey
diff --git a/tests/generic/469 b/tests/generic/469
index 47fdf0cf..ba13e022 100755
--- a/tests/generic/469
+++ b/tests/generic/469
@@ -43,7 +43,7 @@ _require_test
 
 run_fsx()
 {
-	$here/ltp/fsx $2 --replay-ops $1 $file 2>&1 | tee -a $seqres.full >$tmp.fsx
+	$here/ltp/fsx $2 --replay-ops $1 $FSX_AVOID $file 2>&1 | tee -a $seqres.full >$tmp.fsx
 	if [ ${PIPESTATUS[0]} -ne 0 ]; then
 		cat $tmp.fsx
 		exit 1
diff --git a/tests/generic/499 b/tests/generic/499
index 773eab2e..61346832 100755
--- a/tests/generic/499
+++ b/tests/generic/499
@@ -50,7 +50,7 @@ ENDL
 
 victim=$SCRATCH_MNT/a
 touch $victim
-$here/ltp/fsx --replay-ops $tmp.fsxops $victim > $tmp.output 2>&1 || cat $tmp.output
+$here/ltp/fsx --replay-ops $tmp.fsxops $FSX_AVOID $victim > $tmp.output 2>&1 || cat $tmp.output
 
 echo "Silence is golden"
 status=0
diff --git a/tests/generic/511 b/tests/generic/511
index 4d133f49..346e291d 100755
--- a/tests/generic/511
+++ b/tests/generic/511
@@ -47,7 +47,7 @@ ENDL
 
 victim=$SCRATCH_MNT/a
 touch $victim
-$here/ltp/fsx --replay-ops $tmp.fsxops $victim > $tmp.output 2>&1 || cat $tmp.output
+$here/ltp/fsx --replay-ops $tmp.fsxops $FSX_AVOID $victim > $tmp.output 2>&1 || cat $tmp.output
 
 echo "Silence is golden"
 status=0
-- 
2.21.0




  reply	other threads:[~2020-01-06  7:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-06  7:06 [PATCH v2 1/2] ltp/fsx.c: Add FALLOC_FL_KEEP_SIZE flag and '-K' option Xiao Yang
2020-01-06  7:06 ` Xiao Yang [this message]
2020-01-06 11:24   ` [PATCH v2 2/2] fsx: Add '-a' option to skip unsupported keep size automatically Amir Goldstein
2020-01-07  2:10     ` Xiao Yang
2020-01-07  6:47       ` Amir Goldstein
2020-01-07  7:44         ` Xiao Yang
2020-01-07  8:49           ` Amir Goldstein
2020-01-13  2:06             ` Xiao Yang

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=20200106070654.13249-2-yangx.jy@cn.fujitsu.com \
    --to=yangx.jy@cn.fujitsu.com \
    --cc=eguan@linux.alibaba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.