* [PATCH v3 1/2] ltp/fsx.c: Add FALLOC_FL_KEEP_SIZE flag and '-K' option
@ 2020-01-07 8:40 Xiao Yang
2020-01-07 8:40 ` [PATCH v3 2/2] generic: Add check for required keep_size/punch_hole/zero_range/collapse_range Xiao Yang
0 siblings, 1 reply; 3+ messages in thread
From: Xiao Yang @ 2020-01-07 8:40 UTC (permalink / raw)
To: eguan, amir73il; +Cc: fstests, Xiao Yang
1) Add FALLOC_FL_KEEP_SIZE flag for do_zero_range().
2) Add missing '-K' option to the usage of fsx.
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
ltp/fsx.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/ltp/fsx.c b/ltp/fsx.c
index 00001117..997d3f37 100644
--- a/ltp/fsx.c
+++ b/ltp/fsx.c
@@ -1197,7 +1197,7 @@ void
do_zero_range(unsigned offset, unsigned length, int keep_size)
{
unsigned end_offset;
- int mode = FALLOC_FL_ZERO_RANGE;
+ int mode = keep_size ? FALLOC_FL_ZERO_RANGE | FALLOC_FL_KEEP_SIZE : FALLOC_FL_ZERO_RANGE;
if (length == 0) {
if (!quiet && testcalls > simulatedopcount)
@@ -2223,7 +2223,7 @@ void
usage(void)
{
fprintf(stdout, "usage: %s",
- "fsx [-dknqxABEFJLOWZ] [-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 [-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\
-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\
@@ -2273,6 +2273,9 @@ usage(void)
#ifdef HAVE_COPY_FILE_RANGE
" -E: Do not use copy range calls\n"
#endif
+#ifdef FALLOC_FL_KEEP_SIZE
+" -K: Do not use keep size calls\n"
+#endif
" -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\
--
2.21.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v3 2/2] generic: Add check for required keep_size/punch_hole/zero_range/collapse_range
2020-01-07 8:40 [PATCH v3 1/2] ltp/fsx.c: Add FALLOC_FL_KEEP_SIZE flag and '-K' option Xiao Yang
@ 2020-01-07 8:40 ` Xiao Yang
2020-01-07 10:15 ` Amir Goldstein
0 siblings, 1 reply; 3+ messages in thread
From: Xiao Yang @ 2020-01-07 8:40 UTC (permalink / raw)
To: eguan, amir73il; +Cc: fstests, Xiao Yang
Tests need the exact operations to reproduce some issues by --replay-ops so skip tests
rather than one operation if a required operation/flag in tests is not supported.
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
tests/generic/456 | 3 +++
tests/generic/469 | 3 +++
tests/generic/499 | 1 +
tests/generic/511 | 1 +
4 files changed, 8 insertions(+)
diff --git a/tests/generic/456 b/tests/generic/456
index 6124f0bb..434a0ffa 100755
--- a/tests/generic/456
+++ b/tests/generic/456
@@ -36,6 +36,9 @@ _supported_fs generic
_supported_os Linux
_require_scratch
_require_dm_target flakey
+_require_xfs_io_command "falloc" "-k"
+_require_xfs_io_command "fzero"
+_require_xfs_io_command "fcollapse"
rm -f $seqres.full
diff --git a/tests/generic/469 b/tests/generic/469
index 47fdf0cf..e9411d47 100755
--- a/tests/generic/469
+++ b/tests/generic/469
@@ -40,6 +40,9 @@ rm -f $seqres.full
_supported_fs generic
_supported_os Linux
_require_test
+_require_xfs_io_command "falloc" "-k"
+_require_xfs_io_command "fpunch"
+_require_xfs_io_command "fzero"
run_fsx()
{
diff --git a/tests/generic/499 b/tests/generic/499
index 773eab2e..b3363ac4 100755
--- a/tests/generic/499
+++ b/tests/generic/499
@@ -28,6 +28,7 @@ _cleanup()
_supported_fs generic
_supported_os Linux
_require_scratch
+_require_xfs_io_command "falloc" "-k"
_require_xfs_io_command "fcollapse"
_require_xfs_io_command "fzero"
diff --git a/tests/generic/511 b/tests/generic/511
index 4d133f49..f8022905 100755
--- a/tests/generic/511
+++ b/tests/generic/511
@@ -28,6 +28,7 @@ _cleanup()
_supported_fs generic
_supported_os Linux
_require_scratch
+_require_xfs_io_command "falloc" "-k"
_require_xfs_io_command "fzero"
rm -f $seqres.full
--
2.21.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3 2/2] generic: Add check for required keep_size/punch_hole/zero_range/collapse_range
2020-01-07 8:40 ` [PATCH v3 2/2] generic: Add check for required keep_size/punch_hole/zero_range/collapse_range Xiao Yang
@ 2020-01-07 10:15 ` Amir Goldstein
0 siblings, 0 replies; 3+ messages in thread
From: Amir Goldstein @ 2020-01-07 10:15 UTC (permalink / raw)
To: Xiao Yang; +Cc: eguan, fstests
On Tue, Jan 7, 2020 at 10:45 AM Xiao Yang <yangx.jy@cn.fujitsu.com> wrote:
>
> Tests need the exact operations to reproduce some issues by --replay-ops so skip tests
> rather than one operation if a required operation/flag in tests is not supported.
>
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Thanks
> ---
> tests/generic/456 | 3 +++
> tests/generic/469 | 3 +++
> tests/generic/499 | 1 +
> tests/generic/511 | 1 +
> 4 files changed, 8 insertions(+)
>
> diff --git a/tests/generic/456 b/tests/generic/456
> index 6124f0bb..434a0ffa 100755
> --- a/tests/generic/456
> +++ b/tests/generic/456
> @@ -36,6 +36,9 @@ _supported_fs generic
> _supported_os Linux
> _require_scratch
> _require_dm_target flakey
> +_require_xfs_io_command "falloc" "-k"
> +_require_xfs_io_command "fzero"
> +_require_xfs_io_command "fcollapse"
>
> rm -f $seqres.full
>
> diff --git a/tests/generic/469 b/tests/generic/469
> index 47fdf0cf..e9411d47 100755
> --- a/tests/generic/469
> +++ b/tests/generic/469
> @@ -40,6 +40,9 @@ rm -f $seqres.full
> _supported_fs generic
> _supported_os Linux
> _require_test
> +_require_xfs_io_command "falloc" "-k"
> +_require_xfs_io_command "fpunch"
> +_require_xfs_io_command "fzero"
>
> run_fsx()
> {
> diff --git a/tests/generic/499 b/tests/generic/499
> index 773eab2e..b3363ac4 100755
> --- a/tests/generic/499
> +++ b/tests/generic/499
> @@ -28,6 +28,7 @@ _cleanup()
> _supported_fs generic
> _supported_os Linux
> _require_scratch
> +_require_xfs_io_command "falloc" "-k"
> _require_xfs_io_command "fcollapse"
> _require_xfs_io_command "fzero"
>
> diff --git a/tests/generic/511 b/tests/generic/511
> index 4d133f49..f8022905 100755
> --- a/tests/generic/511
> +++ b/tests/generic/511
> @@ -28,6 +28,7 @@ _cleanup()
> _supported_fs generic
> _supported_os Linux
> _require_scratch
> +_require_xfs_io_command "falloc" "-k"
> _require_xfs_io_command "fzero"
>
> rm -f $seqres.full
> --
> 2.21.0
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-01-07 10:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07 8:40 [PATCH v3 1/2] ltp/fsx.c: Add FALLOC_FL_KEEP_SIZE flag and '-K' option Xiao Yang
2020-01-07 8:40 ` [PATCH v3 2/2] generic: Add check for required keep_size/punch_hole/zero_range/collapse_range Xiao Yang
2020-01-07 10:15 ` Amir Goldstein
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.