Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#906846: mount: Fails to notice that a loopdevice cannot be removed

13 views
Skip to first unread message

Gunnar Wolf

unread,
Aug 21, 2018, 1:20:03 PM8/21/18
to
Package: mount
Version: 2.32-0.1
Severity: normal

If I request losetup to detach from a loop device and it cannot be
detached, I would expect it to notify me accordingly. However:

# losetup --list
NAME SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE DIO LOG-SEC
/dev/loop1 0 0 1 0 /home/gwolf/vcs/raspi3-image-spec/raspi3.img (deleted) 0 512
# if losetup --detach /dev/loop1 ; then echo SUCCESS; else echo FAIL; fi
SUCCESS
# losetup --list
NAME SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE DIO LOG-SEC
/dev/loop1 0 0 1 0 /home/gwolf/vcs/raspi3-image-spec/raspi3.img (deleted) 0 512

When requesting debug information, it seems losetup actually believes
the loopback was dropped - but it is false:

# LOOPDEV_DEBUG=all losetup --detach /dev/loop1
9932: loopdev: CXT: [0x7ffeaa764d60]: initialize context
9932: loopdev: CXT: [0x7ffeaa764d60]: init: ignore ioctls
9932: loopdev: CXT: [0x7ffeaa764d60]: init: loop-control detected
9932: loopdev: CXT: [0x7ffeaa764d60]: /dev/loop1 name assigned
9932: loopdev: CXT: [0x7ffeaa764d60]: open /dev/loop1 [ro]: Success
9932: loopdev: CXT: [0x7ffeaa764d60]: device removed
9932: loopdev: CXT: [0x7ffeaa764d60]: de-initialize
9932: loopdev: CXT: [0x7ffeaa764d60]: closing old open fd
9932: loopdev: ITER: [0x7ffeaa764f18]: de-initialize
# losetup --list
NAME SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE DIO LOG-SEC
/dev/loop1 0 0 1 0 /home/gwolf/vcs/raspi3-image-spec/raspi3.img (deleted) 0 512

Thank you very much for looking into this!

-- System Information:
Debian Release: buster/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.15.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages mount depends on:
ii libblkid1 2.32-0.1
ii libc6 2.27-3
ii libmount1 2.32-0.1
ii libselinux1 2.8-1
ii libsmartcols1 2.32-0.1
ii util-linux 2.32-0.1

mount recommends no packages.

Versions of packages mount suggests:
pn nfs-common <none>

-- no debconf information

Chris Hofstaedtler

unread,
Apr 16, 2022, 4:10:04 PM4/16/22
to
Hi Gunnar,

* Gunnar Wolf <gw...@gwolf.org> [220416 19:54]:
Sorry for the long time with no reply to your bug.

I took a closer look today; I can reproduce this -if- I have a
filesystem mounted using that loop device. This comment from
upstream explains whats going on:
https://github.com/util-linux/util-linux/issues/484#issuecomment-321506607

Apparently losetup cannot (really) know that the kernel ignores the
detach ioctl. I would say there is no bug in util-linux. Maybe you
want to talk to the kernel folks?

Best,
Chris
0 new messages