]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lsblk: ignore only loopdevs without backing file
authorKarel Zak <kzak@redhat.com>
Wed, 9 Sep 2020 10:18:07 +0000 (12:18 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 9 Sep 2020 10:23:33 +0000 (12:23 +0200)
commit14bb8e3ca6abaab9a584413d2dd74a6eb2cc18d0
tree84a38d4d50c7b40ef09f86dc5b9530f840ae3db6
parentbb6c51a650fe3469aee819016826c4f2ed2c97c6
lsblk: ignore only loopdevs without backing file

* do not ignore all empty devices, we need more smart solution

* ignore only loop devices without backing file, for example:
 # touch img
 # losetup -f img
 losetup: img: Warning: file is smaller than 512 bytes; the loop device may be useless or invisible for system tools.

 - old version display nothing
 - new version:

 # lsblk /dev/loop0
 NAME  MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
 loop0   7:0    0   0B  0 loop

Addresses: https://github.com/karelzak/util-linux/issues/1118
Signed-off-by: Karel Zak <kzak@redhat.com>
include/loopdev.h
lib/loopdev.c
misc-utils/lsblk.c