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

Cyril Hrubis
2022-09-22T10:54:37Z

Hi!
> > This seems a bit tricky to distinguish EXT2,3,4, from what I know,
> > they use the same magic number. It will be difficult to get the
> > FS block and extract smaller granularity of feature without
> > using fs helper tools.
>
> Yep, magic is the same: 0xef53 (not count the old ext2: 0xef51).
> I thought that I'd map ext[235] to "ext2/ext3/ext4".
> But maybe it's not a good idea.
>
> OTOH df (coreutils) manages to distinguish them, stat can't.
> I looked into df sources, it looks read_file_system_list() from gnulib which
> it uses, reads /proc/self/mountinfo. Wouldn't be better to follow this approach
> in tst_fs_type_() instead of using statfs()? (using st_dev - major:minor from
> stat to match). I guess we always read mounted filesystem, thus it'd be a
> drop-in replacement, we'd not need tst_fs_type_name() any more.

The real problem is that the line between ext2, ext3 and ext4 is really
blurry to an extend where it's hard to say which filesystem are you
working with. For example while ext2 kernel driver still exists and is
in use on embedded hardware modern distributions use single ext driver
to handle all three filesystems. Also I think that it was possible to
mount ext3 with ext2 driver at some point which disabled the journaling.

--
Cyril Hrubis
chrubis@suse.cz