Message ID | 20220818095030.1964355-1-liwang@redhat.com |
---|---|
State | Accepted |
Headers | show |
Series | statx04: mask STATX_ATTR_COMPRESSED on tmpfs | expand |
Hi Li > Recently a new kernel commit (e408e695f) introduces the inode attributes > being supported in tmpfs, which is like other Linux file systems. But that > caused statx04 to throw an unsupported error in STATX_ATTR_COMPRESSED. > > This patch help masks it just like what we did for XFS. Looks good to me, Reviewed-by: Yang Xu <xuyang2018.jy@fujitsu.com> Best Regards Yang Xu > > tst_test.c:1599: TINFO: Testing on tmpfs > tst_test.c:1064: TINFO: Skipping mkfs for TMPFS filesystem > tst_test.c:1045: TINFO: Limiting tmpfs size to 32MB > statx04.c:114: TFAIL: STATX_ATTR_COMPRESSED not supported > statx04.c:112: TPASS: STATX_ATTR_APPEND is supported > statx04.c:112: TPASS: STATX_ATTR_IMMUTABLE is supported > statx04.c:112: TPASS: STATX_ATTR_NODUMP is supported > > Signed-off-by: Li Wang <liwang@redhat.com> > --- > testcases/kernel/syscalls/statx/statx04.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/testcases/kernel/syscalls/statx/statx04.c b/testcases/kernel/syscalls/statx/statx04.c > index 083298310..03d909534 100644 > --- a/testcases/kernel/syscalls/statx/statx04.c > +++ b/testcases/kernel/syscalls/statx/statx04.c > @@ -17,7 +17,7 @@ > * xfs filesystem doesn't support STATX_ATTR_COMPRESSED flag, so we only test > * three other flags. > * > - * ext2, ext4, btrfs and xfs support statx syscall since the following commit > + * ext2, ext4, btrfs, xfs and tmpfs support statx syscall since the following commit > * > * commit 93bc420ed41df63a18ae794101f7cbf45226a6ef > * Author: yangerkun <yangerkun@huawei.com> > @@ -42,6 +42,13 @@ > * Date: Fri Mar 31 18:32:03 2017 +0100 > * > * xfs: report crtime and attribute flags to statx > + * > + * commit e408e695f5f1f60d784913afc45ff2c387a5aeb8 > + * Author: Theodore Ts'o <tytso@mit.edu> > + * Date: Thu Jul 14 21:59:12 2022 -0400 > + * > + * mm/shmem: support FS_IOC_[SG]ETFLAGS in tmpfs > + * > */ > > #define _GNU_SOURCE > @@ -88,8 +95,8 @@ static void setup(void) > for (i = 0, expected_mask = 0; i < ARRAY_SIZE(attr_list); i++) > expected_mask |= attr_list[i].attr; > > - /* STATX_ATTR_COMPRESSED not supported on XFS */ > - if (!strcmp(tst_device->fs_type, "xfs")) > + /* STATX_ATTR_COMPRESSED not supported on XFS, TMPFS */ > + if (!strcmp(tst_device->fs_type, "xfs") || !strcmp(tst_device->fs_type, "tmpfs")) > expected_mask &= ~STATX_ATTR_COMPRESSED; > > /* Attribute support was added to Btrfs statx() in kernel v4.13 */
On Thu, Aug 18, 2022 at 5:55 PM xuyang2018.jy@fujitsu.com < xuyang2018.jy@fujitsu.com> wrote: > Hi Li > > > Recently a new kernel commit (e408e695f) introduces the inode attributes > > being supported in tmpfs, which is like other Linux file systems. But > that > > caused statx04 to throw an unsupported error in STATX_ATTR_COMPRESSED. > > > > This patch help masks it just like what we did for XFS. > > Looks good to me, > Thanks, I suddenly realized that we need to add the commit info into .tag as well. @@ -132,6 +139,7 @@ static struct tst_test test = { {"linux-git", "99652ea56a41"}, {"linux-git", "04a87e347282"}, {"linux-git", "5f955f26f3d4"}, + {"linux-git", "e408e695f5f1"}, {} },
Merged, thanks!
diff --git a/testcases/kernel/syscalls/statx/statx04.c b/testcases/kernel/syscalls/statx/statx04.c index 083298310..03d909534 100644 --- a/testcases/kernel/syscalls/statx/statx04.c +++ b/testcases/kernel/syscalls/statx/statx04.c @@ -17,7 +17,7 @@ * xfs filesystem doesn't support STATX_ATTR_COMPRESSED flag, so we only test * three other flags. * - * ext2, ext4, btrfs and xfs support statx syscall since the following commit + * ext2, ext4, btrfs, xfs and tmpfs support statx syscall since the following commit * * commit 93bc420ed41df63a18ae794101f7cbf45226a6ef * Author: yangerkun <yangerkun@huawei.com> @@ -42,6 +42,13 @@ * Date: Fri Mar 31 18:32:03 2017 +0100 * * xfs: report crtime and attribute flags to statx + * + * commit e408e695f5f1f60d784913afc45ff2c387a5aeb8 + * Author: Theodore Ts'o <tytso@mit.edu> + * Date: Thu Jul 14 21:59:12 2022 -0400 + * + * mm/shmem: support FS_IOC_[SG]ETFLAGS in tmpfs + * */ #define _GNU_SOURCE @@ -88,8 +95,8 @@ static void setup(void) for (i = 0, expected_mask = 0; i < ARRAY_SIZE(attr_list); i++) expected_mask |= attr_list[i].attr; - /* STATX_ATTR_COMPRESSED not supported on XFS */ - if (!strcmp(tst_device->fs_type, "xfs")) + /* STATX_ATTR_COMPRESSED not supported on XFS, TMPFS */ + if (!strcmp(tst_device->fs_type, "xfs") || !strcmp(tst_device->fs_type, "tmpfs")) expected_mask &= ~STATX_ATTR_COMPRESSED; /* Attribute support was added to Btrfs statx() in kernel v4.13 */
Recently a new kernel commit (e408e695f) introduces the inode attributes being supported in tmpfs, which is like other Linux file systems. But that caused statx04 to throw an unsupported error in STATX_ATTR_COMPRESSED. This patch help masks it just like what we did for XFS. tst_test.c:1599: TINFO: Testing on tmpfs tst_test.c:1064: TINFO: Skipping mkfs for TMPFS filesystem tst_test.c:1045: TINFO: Limiting tmpfs size to 32MB statx04.c:114: TFAIL: STATX_ATTR_COMPRESSED not supported statx04.c:112: TPASS: STATX_ATTR_APPEND is supported statx04.c:112: TPASS: STATX_ATTR_IMMUTABLE is supported statx04.c:112: TPASS: STATX_ATTR_NODUMP is supported Signed-off-by: Li Wang <liwang@redhat.com> --- testcases/kernel/syscalls/statx/statx04.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)