All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v5 1/3] syscalls/statx04: Skip STATX_ATTR_COMPRESSED flag when tesing xfs
@ 2021-11-16  7:55 Yang Xu
  2021-11-16  7:55 ` [LTP] [PATCH v5 2/3] syscalls/statx04: remove btrfs kernel version and add linux tags Yang Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Yang Xu @ 2021-11-16  7:55 UTC (permalink / raw)
  To: ltp

Since STATX_ATTR_COMPRESSED flag are non-supported on xfs, we should skip
it and test three other flags.

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 testcases/kernel/syscalls/statx/statx04.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/testcases/kernel/syscalls/statx/statx04.c b/testcases/kernel/syscalls/statx/statx04.c
index f8350ed2d..6881ce261 100644
--- a/testcases/kernel/syscalls/statx/statx04.c
+++ b/testcases/kernel/syscalls/statx/statx04.c
@@ -20,6 +20,9 @@
  * First directory has all flags set.
  * Second directory has no flags set.
  *
+ * xfs filesystem doesn't support STATX_ATTR_COMPRESSED flags, so we only test
+ * three other flags.
+ *
  * Minimum kernel version required is 4.11.
  */
 
@@ -47,10 +50,12 @@ static void test_flagged(void)
 		tst_brk(TFAIL | TTERRNO,
 			"sys_statx(AT_FDCWD, %s, 0, 0, &buf)", TESTDIR_FLAGGED);
 
-	if (buf.stx_attributes & STATX_ATTR_COMPRESSED)
-		tst_res(TPASS, "STATX_ATTR_COMPRESSED flag is set");
-	else
-		tst_res(TFAIL, "STATX_ATTR_COMPRESSED flag is not set");
+	if(strcmp(tst_device->fs_type, "xfs")) {
+		if (buf.stx_attributes & STATX_ATTR_COMPRESSED)
+			tst_res(TPASS, "STATX_ATTR_COMPRESSED flag is set");
+		else
+			tst_res(TFAIL, "STATX_ATTR_COMPRESSED flag is not set");
+	}
 
 	if (buf.stx_attributes & STATX_ATTR_APPEND)
 		tst_res(TPASS, "STATX_ATTR_APPEND flag is set");
@@ -135,7 +140,10 @@ static void caid_flags_setup(void)
 		tst_brk(TBROK | TERRNO, "ioctl(%i, FS_IOC_GETFLAGS, ...)", fd);
 	}
 
-	attr |= FS_COMPR_FL | FS_APPEND_FL | FS_IMMUTABLE_FL | FS_NODUMP_FL;
+	if(!strcmp(tst_device->fs_type, "xfs"))
+		attr |= FS_APPEND_FL | FS_IMMUTABLE_FL | FS_NODUMP_FL;
+	else
+		attr |= FS_COMPR_FL | FS_APPEND_FL | FS_IMMUTABLE_FL | FS_NODUMP_FL;
 
 	ret = ioctl(fd, FS_IOC_SETFLAGS, &attr);
 	if (ret < 0) {
-- 
2.23.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-11-18  1:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-16  7:55 [LTP] [PATCH v5 1/3] syscalls/statx04: Skip STATX_ATTR_COMPRESSED flag when tesing xfs Yang Xu
2021-11-16  7:55 ` [LTP] [PATCH v5 2/3] syscalls/statx04: remove btrfs kernel version and add linux tags Yang Xu
2021-11-16  8:05   ` xuyang2018.jy
2021-11-16  9:49   ` Richard Palethorpe
2021-11-16  7:55 ` [LTP] [PATCH v5 3/3] syscalls/statx08: Add new test Yang Xu
2021-11-16  9:53   ` Richard Palethorpe
2021-11-17  9:48   ` Richard Palethorpe
2021-11-18  1:41     ` xuyang2018.jy
2021-11-16  9:47 ` [LTP] [PATCH v5 1/3] syscalls/statx04: Skip STATX_ATTR_COMPRESSED flag when tesing xfs Richard Palethorpe

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.