Skip to contentSkip to conversation

statx04: mask STATX_ATTR_COMPRESSED on tmpfs

PATCH In review Li Wang 2 participants 4 messages Aug 18, 2022 – Aug 19, 2022

lore
Share & tools
lore

Li Wang

author
#0 lore raw

PATCH 1/1 statx04: mask STATX_ATTR_COMPRESSED on tmpfs

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

---
 testcases/kernel/syscalls/statx/statx04.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
testcases/kernel/syscalls/statx/statx04.c +10 -3
index 083298310..03d909534 100644
@@ -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 <[email protected]>
@@ -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 <[email protected]>
+ *  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 */
Signature · 5 lines
2.35.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v1 1/1
#1 lore raw

Hi Li

Quoted 5 lines

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,

Best Regards
Yang Xu

Quoted 52 lines

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

---
  testcases/kernel/syscalls/statx/statx04.c | 13 ++++++++++---
  1 file changed, 10 insertions(+), 3 deletions(-)
testcases/kernel/syscalls/statx/statx04.c +10 -3
index 083298310..03d909534 100644
@@ -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 <[email protected]>
@@ -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 <[email protected]>
+ *  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 */
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#2 lore raw
Quoted 11 lines · On Thu, Aug 18, 2022 at 5:55 PM [email protected] <…

Hi Li

Quoted 2 lines

Recently a new kernel commit (e408e695f) introduces the inode attributes being supported in tmpfs, which is like other Linux file systems. But

that

Quoted 3 lines

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"},
                {}
        },
Signature · 2 lines
Regards,
Li Wang
Signature · 2 lines
-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
author Applied
#3 lore raw

Merged, thanks!

Signature · 2 lines
Regards,
Li Wang
Signature · 2 lines
-- 
Mailing list info: https://lists.linux.it/listinfo/ltp