[LTP] [PATCH] tst_find_backing_dev: Get dev name from /sys/dev/block/*/uevent

Jan Stancek jstancek@redhat.com
Wed Oct 26 12:56:27 CEST 2022


On Tue, Oct 25, 2022 at 4:59 PM Richard Palethorpe <rpalethorpe@suse.com> wrote:
>
> mountinfo doesn't always contain the correct device name. For example
> /dev/root may be displayed, but not exist in devtmpfs[1].
>
> The unevent file in sysfs is another way of finding the device name
         ^^ small typo here

> from the major and minor numbers. Possibly it always displays the
> proper device name.

major/minor numbers may still fail for btrfs, but that issue exists
outside of scope of this patch.

>
> One caveat is the sysfs can be disabled, so this commit does not
> remove the mountinfo method altogether, but leaves it as a fallback.

Could we add some TINFO message to output, so we know where dev_name
came from? (uevent vs mountinfo)

>
> Alessandro Carminati originally sent two patches[1] which added the
> uevent file method as a fallback. However it seems like the better
> method.
>
> [1]: https://lore.kernel.org/ltp/Y0023HcAOlhfAcJw@lab.hqhome163.com/
>
> Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
> Suggested-by: Alessandro Carminati <alessandro.carminati@gmail.com>
> Reported-by: Alessandro Carminati <alessandro.carminati@gmail.com>

Acked-by: Jan Stancek <jstancek@redhat.com>



More information about the ltp mailing list