* libblkid: check for ext* is deeply broken
@ 2014-04-08 21:52 Stanislav Brabec
2014-04-09 7:43 ` Karel Zak
0 siblings, 1 reply; 2+ messages in thread
From: Stanislav Brabec @ 2014-04-08 21:52 UTC (permalink / raw)
To: util-linux
I am digging into an incorrect detection of ext* filesystems in blkid
2.24.1.
The result of blkid is totally illogical. You cannot write any simple
function that will parse the result. Both prioritizing of TYPE over
SEC_TYPE and vice versa fail for some cases.
ext2 with ext4 module unloaded:
SEC_TYPE="ext2" TYPE="ext4"
ext3 with ext4 module unloaded:
SEC_TYPE="ext2" TYPE="ext3"
ext4 with ext4 module unloaded:
TYPE="ext4"
ext2 with ext4 module loaded:
TYPE="ext2"
ext3 with ext4 module loaded:
SEC_TYPE="ext2" TYPE="ext3"
ext4 with ext4 module loaded:
TYPE="ext4"
I even don't know, what was intended to be returned on system that
supports ext2 via ext4:
SEC_TYPE="ext2" TYPE="ext4"
or
TYPE="ext2"?
If the first one, all system_supports_ext?() have to be rewritten to
detect loaded ext4 module supporting ext2.
If the second one, system_supports_ext4_ext2() should be moved inside
system_supports?() calls.
In both cases, expressions using these calls have to be rewritten.
Details:
It seems, that the code attempts to be intelligent and detect the best
possible support for the particular file system.
But check as they are written are broken, return inconsistent results
and cannot be fixed to be consistent:
check_for_modules("ext2") correctly returns that module named "ext2"
does not exist (only "ext4" does).
But at least on a new Linux kernel version I am working on
fs_proc_check("ext2") returns success whenever ext4 module is loaded.
It is because /proc/filesystems include "ext2", even if the module is
named "ext4".
It causes system_supports_ext?() being inconsistent between calls with
"ext4" module loaded and "ext4" module unloaded.
It implies, that all subsequent logic expressions in probe_ext* are
inconsistent and makes no sense as well. Additionally, I guess that some
of these checks are incorrect per self. (As long as only one
probe_ext?() returns success, then blkid returns at least something.)
--
Best Regards / S pozdravem,
Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o. e-mail: sbrabec@suse.cz
Lihovarská 1060/12 tel: +49 911 7405384547
190 00 Praha 9 fax: +420 284 084 001
Czech Republic http://www.suse.cz/
PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: libblkid: check for ext* is deeply broken
2014-04-08 21:52 libblkid: check for ext* is deeply broken Stanislav Brabec
@ 2014-04-09 7:43 ` Karel Zak
0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2014-04-09 7:43 UTC (permalink / raw)
To: Stanislav Brabec; +Cc: util-linux
On Tue, Apr 08, 2014 at 11:52:38PM +0200, Stanislav Brabec wrote:
> It implies, that all subsequent logic expressions in probe_ext* are
> inconsistent and makes no sense as well. Additionally, I guess that some
> of these checks are incorrect per self. (As long as only one
> probe_ext?() returns success, then blkid returns at least something.)
commit a1ca32fb3862ccac7275d6b342805b6d99f20e39
Author: Lukas Czerner <lczerner@redhat.com>
Date: Tue Dec 3 16:24:44 2013 +0100
libblkid: Identify extN file system properly
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-04-09 7:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-08 21:52 libblkid: check for ext* is deeply broken Stanislav Brabec
2014-04-09 7:43 ` Karel Zak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox