FS/XFS testing framework
 help / color / mirror / Atom feed
From: Zorro Lang <zlang@kernel.org>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: "fstests@vger.kernel.org" <fstests@vger.kernel.org>
Subject: Re: [PATCH] generic/683: _require_chmod
Date: Sat, 22 Aug 2026 15:36:03 +0800	[thread overview]
Message-ID: <aolLssogdhI_LWf3@zlang-mailbox> (raw)
In-Reply-To: <3801889e-b173-4971-bb84-11f5e3434705@sandeen.net>

On Thu, Aug 20, 2026 at 09:57:56AM -0500, Eric Sandeen wrote:
> On 8/20/26 9:37 AM, Zorro Lang wrote:
> > On Wed, Aug 19, 2026 at 03:32:01PM -0500, Eric Sandeen wrote:
> >> generic/683 uses chmod but does not _require_chmod, so filesystems
> >> like exfat fail.
> >>
> >> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> >> ---
> > 
> > Hi Eric,
> > 
> > So great to see you ! This patch makes sense to me. Actually, g/683 belongs
> > to the same group/patchset of SUID test cases as g/684 through g/688, and all
> > of them use chmod. If we need to add _require_chmod to g/683, I would suggest
> > adding it to all of them.
> 
> Ok, fair enough - I should have looked more closely, and when running exfat
> all of those tests properly did a _notrun due to /other/ constraints, but
> we probably should explicitly mark each requirement even if they are
> stacked.

Maybe some of the other _require_ checks helped those tests to _notrun on exfat.

> 
> I wonder if some sort of checkpatch or linter for xfstests might be
> helpful, it's pretty simple to grep a test for chmod and ensure that
> it has _require_chmod for example.

Sure, I just tried this:

  #!/bin/bash

  TESTS_DIR="${1:-tests}"

  find "$TESTS_DIR" -type f -regex '.*/[0-9]+$' | sort | while read -r test_file; do
        if grep -qE '^[[:space:]]*_require_chmod\b' "$test_file"; then
                continue
        fi

        if grep -v '^[[:space:]]*#' "$test_file" | grep -qE '\b(chmod|\$CHMOD_PROG)\b'; then
                echo "[Miss _require_chmod] $test_file"
                grep -v '^[[:space:]]*#' "$test_file" | grep -nE '\b(chmod|\$CHMOD_PROG)\b' | sed 's/^/    Line /'
        fi
  done

Not sure if we should blindly add _require_chmod to every single case we found.

>
> ... or I wonder if it would be runtime-prohibitive to just build that
> into the check script; if the script contains "chmod," run _require_chmod
> automatically... similar for all the other trivial _require tests.
> 
> But maybe that's trying to be too clever. :)

xfstests contains thousands of test cases, so this approach would introduce
substantial redundant overhead and frustrate a lot of developers :)

Thanks,
Zorro

> 
> -Eric
> 
> > Thanks,
> > Zorro
> > 
> >>
> >> diff --git a/tests/generic/683 b/tests/generic/683
> >> index 883905da..226d2758 100755
> >> --- a/tests/generic/683
> >> +++ b/tests/generic/683
> >> @@ -24,6 +24,7 @@ _cleanup()
> >>  # Modify as appropriate.
> >>  _require_user
> >>  _require_test
> >> +_require_chmod
> >>  verb=falloc
> >>  _require_xfs_io_command $verb
> >>  _require_congruent_file_oplen $TEST_DIR 65536
> >>
> 
> 

      reply	other threads:[~2026-08-22  7:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-19 20:32 [PATCH] generic/683: _require_chmod Eric Sandeen
2026-08-20 14:37 ` Zorro Lang
2026-08-20 14:57   ` Eric Sandeen
2026-08-22  7:36     ` Zorro Lang [this message]

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=aolLssogdhI_LWf3@zlang-mailbox \
    --to=zlang@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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