From: Eric Biggers <ebiggers@kernel.org>
To: fstests@vger.kernel.org
Subject: [PATCH] generic/423: test stx_size of symlink
Date: Sun, 18 Jul 2021 10:17:46 -0500 [thread overview]
Message-ID: <20210718151746.40010-1-ebiggers@kernel.org> (raw)
From: Eric Biggers <ebiggers@google.com>
Update generic/423 to test that the reported size of a symlink is equal
to the length of the symlink target, as required by POSIX and as
documented in various man pages.
When the test_dummy_encryption mount option is enabled, this serves as a
regression test for the bug that will be fixed by the patch series
"fscrypt: report correct st_size for encrypted symlinks"
(https://lkml.kernel.org/r/20210702065350.209646-1-ebiggers@kernel.org).
However, this test is applicable to all filesystems and mount options.
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
In the past, it's been mentioned that existing xfstests shouldn't be
updated to test new things
(https://lkml.kernel.org/r/20170315093942.GN14226@eguan.usersys.redhat.com).
I personally think this is a dumb policy and that we should make
improvements like this that belong in the existing tests. But if it's
really preferred I could instead add a new test script just for this...
tests/generic/423 | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/generic/423 b/tests/generic/423
index 3de2f30c..69c1c3bc 100755
--- a/tests/generic/423
+++ b/tests/generic/423
@@ -110,13 +110,15 @@ check_stat $TEST_DIR/$seq-file \
stx_nlink=1
echo "Test statx on a symlink"
-ln -s $TEST_DIR/$seq-nowhere $TEST_DIR/$seq-symlink
+target=$TEST_DIR/$seq-nowhere
+ln -s $target $TEST_DIR/$seq-symlink
check_stat $TEST_DIR/$seq-symlink \
ts_order \
ref=$TEST_DIR/$seq-file \
ts=B,b \
ts=M,m \
stx_type=sym \
+ stx_size=${#target} \
stx_rdev_major=0 \
stx_rdev_minor=0 \
stx_nlink=1
base-commit: 623b4ea4082b8be71acaf261435d33fa4488993a
--
2.32.0
reply other threads:[~2021-07-18 15:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210718151746.40010-1-ebiggers@kernel.org \
--to=ebiggers@kernel.org \
--cc=fstests@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 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.