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: Re: [PATCH] misc: allow zero duration for fsstress and fsx
Date: Wed, 21 Jan 2026 09:46:01 -0800 [thread overview]
Message-ID: <20260121174601.GE5945@frogsfrogsfrogs> (raw)
In-Reply-To: <20260121155456.pf6jeprhzua3rdl3@dell-per750-06-vm-08.rhts.eng.pek2.redhat.com>
On Wed, Jan 21, 2026 at 11:54:56PM +0800, Zorro Lang wrote:
> On Tue, Jan 20, 2026 at 05:26:21PM -0800, Darrick J. Wong wrote:
> > 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.
>
> Sure, duration=0 is harmless, I'm good with this patch.
>
> Reviewed-by: Zorro Lang <zlang@redhat.com>
>
> Please excuse my nitpicking. I'm curious about the semantics of "--duration=0".
> Looking at the output of `fsstress -v --duration=0`, it doesn't actually
> 'do nothing.' Instead, it behaves similarly to duration=1, where fsstress
> attempts to execute operations before timing out and exiting :-D
Yeah, I suppose it's possible to do a very small amount of work.
Would you mind changing that last sentence to read "It's harmless to
exit almost immediately having done very little work, so allow this
corner case." prior to commit?
--D
> Thanks,
> Zorro
>
> >
> > 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);
> > }
> >
>
>
next prev parent reply other threads:[~2026-01-21 17:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-21 1:26 [PATCH] misc: allow zero duration for fsstress and fsx Darrick J. Wong
2026-01-21 6:45 ` Christoph Hellwig
2026-01-21 15:54 ` Zorro Lang
2026-01-21 17:46 ` Darrick J. Wong [this message]
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=20260121174601.GE5945@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