Comments (3)
Maybe losetup should be more competent when testing if the device is used.
Now (in your case) it checks for "offset" (sysfs file loop/offset, the file is missing so it assumes the device is unused). Maybe when it scans for the devices in sysfs it should also check for the device lost and ignore such devices.
from util-linux.
The file /dev/loop-control is optional, and if it's not available, then it scans for /dev/loopN files. It seems that it was able to get /dev/loop0, but later it disappeared, so it's reported as lost.
LOOPDEV_DEBUG=all losetup --find
may provide more details.
Not sure why do you see the problem (maybe more tests running in parallel, udevadm settle is good friend).
I'm not able to reproduce it:
# systemd-nspawn -D / --volatile=yes bash
Spawning container vm-10-0-187-68.hosted.upshift.rdu2.redhat.com on /.
Press Ctrl-] three times within 1s to kill container.
bash-5.2# losetup --find
/dev/loop0
bash-5.2# losetup -V
losetup from util-linux 2.40-rc1
from util-linux.
Ah, interesting, thank you. I think the reason here why this happens is that I have (or had) /dev/loop0
used on the host machine, so it's then reported as lost in the container, since it's not there (but it's still present in /sys
).
[root@localhost ~]# losetup --find
/dev/loop0
[root@localhost ~]# systemd-nspawn -D / --volatile=yes --bind $PWD:/build bash
Spawning container localhost.localdomain on /.
Press Ctrl-] three times within 1s to kill container.
bash-5.2# LOOPDEV_DEBUG=all losetup --find
2: loopdev: CXT: [0x7ffc49e1e7d0]: initialize context
2: loopdev: CXT: [0x7ffc49e1e7d0]: init: ignore ioctls
2: loopdev: CXT: [0x7ffc49e1e7d0]: find_unused requested
2: loopdev: CXT: [0x7ffc49e1e7d0]: using loop scan
2: loopdev: ITER: [0x7ffc49e1e9b8]: initialize
2: loopdev: ITER: [0x7ffc49e1e9b8]: next
2: loopdev: ITER: [0x7ffc49e1e9b8]: next: default check
2: loopdev: CXT: [0x7ffc49e1e7d0]: loop0 name assigned
2: loopdev: CXT: [0x7ffc49e1e7d0]: get_offset [rc=-22]
2: loopdev: ITER: [0x7ffc49e1e9b8]: de-initialize
2: loopdev: CXT: [0x7ffc49e1e7d0]: find_unused by scan [rc=0]
/dev/loop0 (lost)
2: loopdev: CXT: [0x7ffc49e1e7d0]: de-initialize
2: loopdev: ITER: [0x7ffc49e1e9b8]: de-initialize
# ls /sys/block/
loop0 vda zram0
So I guess the test needs to be updated on our side, to not use losetup --find
to check if loop devices are available.
from util-linux.
Related Issues (20)
- lscpu coredump
- meson: Builds blkzone despite missing linux/blkzoned.h header HOT 1
- Make hexdump sparse aware HOT 1
- Last partition created by fdisk overlaps with GPT secondary header? HOT 3
- issue file : white and lightgray don't work, plus there are some mistakes in agetty's man page
- lsfd: Fail to get PIDFD.PID with mainline kernel
- lsfd: mkfds-multiplexing-{pselect6,poll,ppoll} fail on MIPS64 HOT 12
- Configure error even if liblastlog2 is not selected HOT 1
- lsblk --json uses a list with one 'null' item to represent "none" HOT 2
- 2.40 build failure HOT 4
- 2.40 does not build on older kernels HOT 4
- 2.40: Release tarball is missing pam_lastlog2/meson.build file HOT 2
- meson: Only require the crypt library when necessary HOT 1
- meson: Do not require the rt library when checking for a function's existence HOT 1
- meson: mempcpy is incorrectly detected as available on macOS
- meson: HAVE_ENVIRON_DECL is being defined despite not being available on macOS
- meson: Can't build libuuid without libmount HOT 1
- lsfd: mkfds-multiplexing-{pselect6,poll,ppoll} fail on 32bit arm Linux 5.10 HOT 2
- build error when building 32bit libraries on x86_64 host HOT 7
- uuid is missing uuid_clear when building with meson HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from util-linux.