[LTP] [PATCH 1/2] lib: Add ntfs3 magic

Brian Mak bmak@nvidia.com
Sat Nov 21 01:36:52 CET 2026


Tests currently running on ntfs3 print "unknown" as the filesystem name:
  tse_swap.c:228: TFAIL: swapon() on unknown failed: EINVAL (22)

Add TST_NTFS3_MAGIC and map it to "ntfs3".

Signed-off-by: Brian Mak <bmak@nvidia.com>
---
 include/tst_fs.h  | 1 +
 lib/tst_fs_type.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/include/tst_fs.h b/include/tst_fs.h
index 80eb1292e..0a6c863cb 100644
--- a/include/tst_fs.h
+++ b/include/tst_fs.h
@@ -34,6 +34,7 @@
 #define TST_FUSE_MAGIC     0x65735546
 #define TST_VFAT_MAGIC     0x4d44 /* AKA MSDOS */
 #define TST_EXFAT_MAGIC    0x2011BAB0UL
+#define TST_NTFS3_MAGIC    0x7366746e
 
 /* fs/bcachefs/bcachefs_format.h */
 #define TST_BCACHE_MAGIC		0xca451a4e
diff --git a/lib/tst_fs_type.c b/lib/tst_fs_type.c
index e9efb89dc..703225c09 100644
--- a/lib/tst_fs_type.c
+++ b/lib/tst_fs_type.c
@@ -74,6 +74,8 @@ const char *tst_fs_type_name(long f_type)
 		return "vfat";
 	case TST_EXFAT_MAGIC:
 		return "exfat";
+	case TST_NTFS3_MAGIC:
+		return "ntfs3";
 	default:
 		return "unknown";
 	}
-- 
2.53.0



More information about the ltp mailing list