public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Zorro Lang <zlang@redhat.com>
Cc: fstests <fstests@vger.kernel.org>, xfs <linux-xfs@vger.kernel.org>
Subject: [PATCH] misc: allow zero duration for fsstress and fsx
Date: Tue, 20 Jan 2026 17:26:21 -0800	[thread overview]
Message-ID: <20260121012621.GE15541@frogsfrogsfrogs> (raw)

From: Darrick J. Wong <djwong@kernel.org>

Occasionally the common/fuzzy fuzz test helpers manage to time
something just right such that fsx or fsstress get invoked with a zero
second duration.  It's harmless to exit immediately without doing
anything, so allow this corner case.

Cc: <fstests@vger.kernel.org> # v2023.05.01
Fixes: 3e85dd4fe4236d ("misc: add duration for long soak tests")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
 ltp/fsstress.c |    2 +-
 ltp/fsx.c      |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ltp/fsstress.c b/ltp/fsstress.c
index c17ac440414325..b51bd8ada2a3be 100644
--- a/ltp/fsstress.c
+++ b/ltp/fsstress.c
@@ -645,7 +645,7 @@ int main(int argc, char **argv)
 				exit(87);
 			}
 			duration = strtoll(optarg, NULL, 0);
-			if (duration < 1) {
+			if (duration < 0) {
 				fprintf(stderr, "%lld: invalid duration\n", duration);
 				exit(88);
 			}
diff --git a/ltp/fsx.c b/ltp/fsx.c
index 626976dd4f9f27..4f8a2d5ab1fc08 100644
--- a/ltp/fsx.c
+++ b/ltp/fsx.c
@@ -3375,7 +3375,7 @@ main(int argc, char **argv)
 				exit(87);
 			}
 			duration = strtoll(optarg, NULL, 0);
-			if (duration < 1) {
+			if (duration < 0) {
 				fprintf(stderr, "%lld: invalid duration\n", duration);
 				exit(88);
 			}

             reply	other threads:[~2026-01-21  1:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-21  1:26 Darrick J. Wong [this message]
2026-01-21  6:45 ` [PATCH] misc: allow zero duration for fsstress and fsx Christoph Hellwig
2026-01-21 15:54 ` Zorro Lang
2026-01-21 17:46   ` Darrick J. Wong
2026-01-22  7:21     ` Zorro Lang
2026-01-22 16:13       ` Darrick J. Wong
2026-01-24  5:47         ` Zorro Lang
2026-01-24 16:55           ` 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=20260121012621.GE15541@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=zlang@redhat.com \
    /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