diff mbox series

[1/6] tst_fs_type: Add nsfs, vfat, squashfs to tst_fs_type_name()

Message ID 20220827002815.19116-2-pvorel@suse.cz
State Changes Requested
Headers show
Series Track minimal size per filesystem | expand

Commit Message

Petr Vorel Aug. 27, 2022, 12:28 a.m. UTC
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 include/tst_fs.h  | 5 ++++-
 lib/tst_fs_type.c | 6 ++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

Comments

Cyril Hrubis Aug. 29, 2022, 10:44 a.m. UTC | #1
Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Bird, Tim Aug. 29, 2022, 3:46 p.m. UTC | #2
Minor nit, but the subject line has nsfs when I think it means ntfs.
 -- Tim

> -----Original Message-----
> From: Petr Vorel <pvorel@suse.cz>
> 
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  include/tst_fs.h  | 5 ++++-
>  lib/tst_fs_type.c | 6 ++++++
>  2 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/include/tst_fs.h b/include/tst_fs.h
> index 8159b99eb..a6f934b0f 100644
> --- a/include/tst_fs.h
> +++ b/include/tst_fs.h
> @@ -5,7 +5,7 @@
>  #ifndef TST_FS_H__
>  #define TST_FS_H__
> 
> -/* man 2 statfs or kernel-source/include/linux/magic.h */
> +/* man 2 statfs or kernel-source/include/uapi/linux/magic.h */
>  #define TST_BTRFS_MAGIC    0x9123683E
>  #define TST_NFS_MAGIC      0x6969
>  #define TST_RAMFS_MAGIC    0x858458f6
> @@ -32,6 +32,9 @@
>  #define TST_FUSE_MAGIC     0x65735546
>  #define TST_VFAT_MAGIC     0x4d44 /* AKA MSDOS */
>  #define TST_EXFAT_MAGIC    0x2011BAB0UL
> +#define TST_SQUASHFS_MAGIC 0x73717368
> +/* kernel-source/fs/ntfs/ntfs.h */
> +#define TST_NTFS_MAGIC     0x5346544e
> 
>  enum {
>  	TST_BYTES = 1,
> diff --git a/lib/tst_fs_type.c b/lib/tst_fs_type.c
> index 9de80224b..de4facef5 100644
> --- a/lib/tst_fs_type.c
> +++ b/lib/tst_fs_type.c
> @@ -88,6 +88,12 @@ const char *tst_fs_type_name(long f_type)
>  		return "fuse";
>  	case TST_EXFAT_MAGIC:
>  		return "exfat";
> +	case TST_NTFS_MAGIC:
> +		return "ntfs";
> +	case TST_SQUASHFS_MAGIC:
> +		return "squashfs";
> +	case TST_VFAT_MAGIC:
> +		return "vfat";
>  	default:
>  		return "unknown";
>  	}
> --
> 2.37.2
Petr Vorel Aug. 29, 2022, 4:14 p.m. UTC | #3
Hi Tim,

> Minor nit, but the subject line has nsfs when I think it means ntfs.
>  -- Tim
Thanks, will be fixed in v2.

How about XFS using 300 MB vs 16 MB but using different code paths?
How big deal it'd be if we require 300 MB in case testing on kernel with XFS
enabled and xfsprogs installed?

https://lore.kernel.org/ltp/YwyYUzvlxfIGpTwo@yuki/
https://lore.kernel.org/ltp/YwyljsgYIK3AvUr+@pevik/

Kind regards,
Petr
Bird, Tim Aug. 29, 2022, 4:35 p.m. UTC | #4
> -----Original Message-----
> From: Petr Vorel <pvorel@suse.cz>
> Hi Tim,
> 
> > Minor nit, but the subject line has nsfs when I think it means ntfs.
> >  -- Tim
> Thanks, will be fixed in v2.
> 
> How about XFS using 300 MB vs 16 MB but using different code paths?
> How big deal it'd be if we require 300 MB in case testing on kernel with XFS
> enabled and xfsprogs installed?
> 
> https://lore.kernel.org/ltp/YwyYUzvlxfIGpTwo@yuki/
> https://lore.kernel.org/ltp/YwyljsgYIK3AvUr+@pevik/

I'm not personally aware of any uses of XFS in embedded projects, let alone
ones with a filesystem size of less than 300 MB.  So I think it would be OK.
Such a test might hit some lightly used codepaths, so it might have more likelihood
to reveal a bug in XFS.  But if literally no one is using XFS in this configuration,
I'm not sure how valuable the testing would be.

That said, my knowledge of the embedded ecosystem is not comprehensive.
I just posted a question about this on the celinux-dev and Linux-embedded
mailing lists.  I let you know if I hear of anyone using an XFS filesystem less
than 300 MB in size in their embedded Linux project or device.
 -- Tim
Petr Vorel Aug. 29, 2022, 4:49 p.m. UTC | #5
> > -----Original Message-----
> > From: Petr Vorel <pvorel@suse.cz>
> > Hi Tim,

> > > Minor nit, but the subject line has nsfs when I think it means ntfs.
> > >  -- Tim
> > Thanks, will be fixed in v2.

> > How about XFS using 300 MB vs 16 MB but using different code paths?
> > How big deal it'd be if we require 300 MB in case testing on kernel with XFS
> > enabled and xfsprogs installed?

> > https://lore.kernel.org/ltp/YwyYUzvlxfIGpTwo@yuki/
> > https://lore.kernel.org/ltp/YwyljsgYIK3AvUr+@pevik/

> I'm not personally aware of any uses of XFS in embedded projects, let alone
> ones with a filesystem size of less than 300 MB.  So I think it would be OK.
> Such a test might hit some lightly used codepaths, so it might have more likelihood
> to reveal a bug in XFS.  But if literally no one is using XFS in this configuration,
> I'm not sure how valuable the testing would be.

> That said, my knowledge of the embedded ecosystem is not comprehensive.
> I just posted a question about this on the celinux-dev and Linux-embedded
> mailing lists.  I let you know if I hear of anyone using an XFS filesystem less
> than 300 MB in size in their embedded Linux project or device.
>  -- Tim

Thanks a lot, Tim!

Kind regards,
Petr
Li Wang Aug. 30, 2022, 5:59 a.m. UTC | #6
Reviewed-by: Li Wang <liwang@redhat.com>
diff mbox series

Patch

diff --git a/include/tst_fs.h b/include/tst_fs.h
index 8159b99eb..a6f934b0f 100644
--- a/include/tst_fs.h
+++ b/include/tst_fs.h
@@ -5,7 +5,7 @@ 
 #ifndef TST_FS_H__
 #define TST_FS_H__
 
-/* man 2 statfs or kernel-source/include/linux/magic.h */
+/* man 2 statfs or kernel-source/include/uapi/linux/magic.h */
 #define TST_BTRFS_MAGIC    0x9123683E
 #define TST_NFS_MAGIC      0x6969
 #define TST_RAMFS_MAGIC    0x858458f6
@@ -32,6 +32,9 @@ 
 #define TST_FUSE_MAGIC     0x65735546
 #define TST_VFAT_MAGIC     0x4d44 /* AKA MSDOS */
 #define TST_EXFAT_MAGIC    0x2011BAB0UL
+#define TST_SQUASHFS_MAGIC 0x73717368
+/* kernel-source/fs/ntfs/ntfs.h */
+#define TST_NTFS_MAGIC     0x5346544e
 
 enum {
 	TST_BYTES = 1,
diff --git a/lib/tst_fs_type.c b/lib/tst_fs_type.c
index 9de80224b..de4facef5 100644
--- a/lib/tst_fs_type.c
+++ b/lib/tst_fs_type.c
@@ -88,6 +88,12 @@  const char *tst_fs_type_name(long f_type)
 		return "fuse";
 	case TST_EXFAT_MAGIC:
 		return "exfat";
+	case TST_NTFS_MAGIC:
+		return "ntfs";
+	case TST_SQUASHFS_MAGIC:
+		return "squashfs";
+	case TST_VFAT_MAGIC:
+		return "vfat";
 	default:
 		return "unknown";
 	}