]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libblkid: improve whole-disk detection when read /proc/partitions
authorKarel Zak <kzak@redhat.com>
Tue, 8 Jan 2019 11:07:18 +0000 (12:07 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 8 Jan 2019 11:07:18 +0000 (12:07 +0100)
commit969e8cbeb124581b376bc5534c716d1b18144190
tree4d005f1a26334eaeb79cc8872811e8ba1956579f
parent963413a1adf6767ab17712097e288e1a346f63a7
libblkid: improve whole-disk detection when read /proc/partitions

blkid(8) in high-level mode checks partitions and unpartitioned
whole-disk devices from the file /proc/partitions.

The current heuristic assumes that partition name ends with a digit.
Unfortunately, this is not correct -- for example md0 or nvme0n1 are
whole-disk devices.

This commit uses sysfs_devno_is_wholedisk() to make sure the device is
a partition (according to kernel or DM). It's probably more expensive,
because this way requires more syscalls (to read stuff from /sys etc.).

The patch also adds more information to the blkid(8) man page.

Addresses: https://github.com/karelzak/util-linux/issues/728
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/devname.c
misc-utils/blkid.8