[LTP] [PATCH] tst_supported_fs: Implement checking paths against skiplist

Cyril Hrubis chrubis@suse.cz
Thu Sep 22 16:42:21 CEST 2022


Hi!
> Should I understand this that you don't trust /proc/self/mountinfo output?
> (show_mountinfo() in fs/proc_namespace.c in kernel git)?

Not much as I wouldn't trust it, it's just that the ext2/ext3/ext4 names
are just short names for a subset of additional functionality.

Consider this:

$ dd if=/dev/zero of=fsimage.img bs=1024 count=32768
$ mkfs.ext3 fsimage.img
$ tune2fs -O ^has_journal fsimage.img
$ mount -o loop fsimage.img /mntpoint
$ cat /proc/self/mountinfo
43 19 7:0 / /mntpoint rw,relatime - ext3 /dev/loop0 rw

Now we have mounted ext3 without journaling, is that really ext3?

$ umount /mntpoint
$ mount -t ext2 -o loop fsimage.img /mntpoint
$ cat /proc/self/mountinfo
43 19 7:0 / /mntpoint rw,relatime - ext2 /dev/loop0 rw

Now we mounted the same filesystem as ext2.

And in both cases this is handled by the ext4 kernel driver anyways:

$ dmesg
...
EXT4-fs (loop0): mounting ext3 file system using the ext4 subsystem
...
EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
...

So I would argue that these are not three different filesystems, but
just one that can turn on and off various features. And if you look at
'man ext4' you will see that the set of supported features for any extX
variant does change with kernel version.

The question is if we really need to be able to distinguish them or if
we can keep calling them by a common name.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list