From: Eric Biggers Date: Sun, 18 Jul 2021 15:17:46 +0000 (-0500) Subject: generic/423: test stx_size of symlink X-Git-Tag: v2022.05.01~330 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6ae3a3a5ac74100e2eaa13be67050780ea0004fb;p=xfstests-dev.git generic/423: test stx_size of symlink 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 Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- 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