All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Polensky <japo@linux.ibm.com>
To: ltp@lists.linux.it
Subject: [LTP] [RFC PATCH v1 2/2] statmount06.c: Fix incorrect fs_type assumption NTFS->FUSEBLK
Date: Tue, 13 May 2025 18:56:40 +0200	[thread overview]
Message-ID: <20250513165640.185122-3-japo@linux.ibm.com> (raw)
In-Reply-To: <20250513165640.185122-1-japo@linux.ibm.com>

The test incorrectly assumed that a volume mounted with "fuseblk" would report
its fs_type as "ntfs" via statmount, which contradicts the actual mount options
used and the resulting fs_type "fuseblk".

Old behavior:

	sudo LTP_SINGLE_FS_TYPE=ntfs strace -e trace=mount,statmount -o log.log -s 128 -f ./statmount06
	...
	statmount06.c:42: TFAIL: st_mount->str + st_mount->fs_type (fuseblk) != tst_device->fs_type (ntfs)
	...

Relevant log excerpt:

	111740 mount("/dev/zero", "/tmp/mountbWjYuf", "ntfs", 0, NULL) = -1 ENODEV (No such device)
	111749 mount("/dev/loop9", "/tmp/LTP_stai6UG2H/mntpoint", "fuseblk", 0, "allow_other,blksize=4096,fd=4,rootmode=40000,user_id=0,group_id=0") = 0
	111752 statmount({size=24, mnt_id=0x80003ab9, param=STATMOUNT_FS_TYPE}, {size=521, mask=STATMOUNT_FS_TYPE, fs_type="fuseblk"}, 1024, 0) = 0

Signed-off-by: Jan Polensky <japo@linux.ibm.com>
---
 testcases/kernel/syscalls/statmount/statmount06.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/statmount/statmount06.c b/testcases/kernel/syscalls/statmount/statmount06.c
index fe41d5b87e7f..dedf9bba14f9 100644
--- a/testcases/kernel/syscalls/statmount/statmount06.c
+++ b/testcases/kernel/syscalls/statmount/statmount06.c
@@ -28,6 +28,8 @@ static struct statmount *st_mount;
 
 static void run(void)
 {
+	const char *expected_fs_type;
+
 	memset(st_mount, 0, SM_SIZE);
 
 	TST_EXP_PASS(statmount(root_id,	STATMOUNT_FS_TYPE, st_mount,
@@ -37,7 +39,11 @@ static void run(void)
 		return;
 
 	TST_EXP_EQ_LI(st_mount->mask, STATMOUNT_FS_TYPE);
-	TST_EXP_EQ_STR(st_mount->str + st_mount->fs_type, tst_device->fs_type);
+	if (!strcmp(tst_device->fs_type, "ntfs"))
+		expected_fs_type = "fuseblk";
+	else
+		expected_fs_type = tst_device->fs_type;
+	TST_EXP_EQ_STR(st_mount->str + st_mount->fs_type, expected_fs_type);
 }
 
 static void setup(void)
-- 
2.49.0


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

  parent reply	other threads:[~2025-05-13 16:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-13 16:56 [LTP] [RFC PATCH v1 0/2] Fix NTFS-related failures in statmount02 and Jan Polensky
2025-05-13 16:56 ` [LTP] [RFC PATCH v1 1/2] safe_macros.c: Fix missing ro flag for FUSE NTFS mounts Jan Polensky
2025-05-15 19:48   ` Petr Vorel
2025-05-16  6:26     ` Li Wang via ltp
2025-05-21  9:37   ` Cyril Hrubis
2025-05-21  9:55     ` Cyril Hrubis
2025-06-04 11:59       ` Cyril Hrubis
2025-05-13 16:56 ` Jan Polensky [this message]
2025-05-21  9:45   ` [LTP] [RFC PATCH v1 2/2] statmount06.c: Fix incorrect fs_type assumption NTFS->FUSEBLK Cyril Hrubis

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=20250513165640.185122-3-japo@linux.ibm.com \
    --to=japo@linux.ibm.com \
    --cc=ltp@lists.linux.it \
    /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.