]> git.ipfire.org Git - thirdparty/util-linux.git/commit
losetup: report lost loop devices for finding free loop
authorJunxiao Bi <junxiao.bi@oracle.com>
Tue, 7 Nov 2023 18:48:06 +0000 (10:48 -0800)
committerKarel Zak <kzak@redhat.com>
Mon, 27 Nov 2023 08:49:49 +0000 (09:49 +0100)
commit556dac801322edd60485bc45312523527d7e5fc2
tree8909584a81fe24932a790eae2d23d83da7171702
parentfa531311ab4d762afcd76f686350eeaacbe1a555
losetup: report lost loop devices for finding free loop

commit a6ca0456cc6d("loopdev: report lost loop devices") forgot to
report lost loop device for finding free loop case. With this path,
it will show the following if next free loop device is lost.

 # ./losetup -f
 /dev/loop1 (lost)
 # ./losetup -f /tmp/test.img
 lt-losetup: /tmp/test.img: failed to set up loop device: No such file or directory
 lt-losetup: device node /dev/loop1 (7:1) is lost. You may use mknod(1) to recover it.

Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
sys-utils/losetup.c