From: Eric Biggers <ebiggers@kernel.org>
To: fstests@vger.kernel.org
Cc: linux-fscrypt@vger.kernel.org
Subject: [PATCH 2/4] common/rc: fix _require_xfs_io_command with digits in argument
Date: Thu, 12 Oct 2023 23:14:01 -0700 [thread overview]
Message-ID: <20231013061403.138425-3-ebiggers@kernel.org> (raw)
In-Reply-To: <20231013061403.138425-1-ebiggers@kernel.org>
From: Eric Biggers <ebiggers@google.com>
'_require_xfs_io_command set_encpolicy -s' does not work as expected
because the following in the output of 'xfs_io -c "help set_encpolicy"':
-s LOG2_DUSIZE -- log2 of data unit size
... does not match the regex:
"^ -s ([a-zA-Z_]+ )?--"
... because the 2 in the argument name LOG2_DUSIZE is not matched. Fix
the regex to support digits in the argument name.
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
common/rc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/rc b/common/rc
index 259a1ffb..b0452360 100644
--- a/common/rc
+++ b/common/rc
@@ -2717,21 +2717,21 @@ _require_xfs_io_command()
echo $testio | grep -q "foreign file active" && \
_notrun "xfs_io $command $param_checked not supported on $FSTYP"
echo $testio | grep -q "Function not implemented" && \
_notrun "xfs_io $command $param_checked support is missing (missing syscall?)"
echo $testio | grep -q "unknown flag" && \
_notrun "xfs_io $command $param_checked support is missing (unknown flag)"
[ -n "$param" ] || return
if [ -z "$param_checked" ]; then
- $XFS_IO_PROG -c "help $command" | grep -E -q "^ $param ([a-zA-Z_]+ )?--" || \
+ $XFS_IO_PROG -c "help $command" | grep -E -q "^ $param ([a-zA-Z0-9_]+ )?--" || \
_notrun "xfs_io $command doesn't support $param"
else
# xfs_io could result in "command %c not supported" if it was
# built on kernels not supporting pwritev2() calls
echo $testio | grep -q "\(invalid option\|not supported\)" && \
_notrun "xfs_io $command doesn't support $param"
fi
# On XFS, ioctl(FSSETXATTR)(called by xfs_io -c "chattr") maskes off unsupported
# or invalid flags silently so need to check these flags by extra ioctl(FSGETXATTR)
--
2.42.0
next prev parent reply other threads:[~2023-10-13 6:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-13 6:13 [PATCH 0/4] xfstests: test custom crypto data unit size Eric Biggers
2023-10-13 6:14 ` [PATCH 1/4] fscrypt-crypt-util: rename block to data unit Eric Biggers
2023-10-13 6:14 ` Eric Biggers [this message]
2023-10-13 6:14 ` [PATCH 3/4] common/encrypt: support custom data unit size Eric Biggers
2023-10-13 6:14 ` [PATCH 4/4] generic: add test for custom crypto " Eric Biggers
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=20231013061403.138425-3-ebiggers@kernel.org \
--to=ebiggers@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-fscrypt@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox