You have been subscribed to a public bug:

losetup fails with devices created manually by mknod on kernel
5.15.0-69-generic

# fallocate -l 1G test
# mknod -m 660 /dev/loop8 b 7 8
# chown root:disk /dev/loop8
# losetup /dev/loop8 ./test
losetup: ./test: failed to set up loop device: Device or resource busy

Possibly as a result of this patch:
https://lore.kernel.org/lkml/20221208200605.756287-1-isaacmanjar...@google.com/T/

which was introduced in 5.15.0-68:
http://launchpadlibrarian.net/653145495/linux_5.15.0-67.74_5.15.0-68.75.diff.gz

On a machine prior to this change (no issue with losetup):
# cat /sys/module/loop/parameters/max_loop
0
# uname -r
5.15.0-58-generic

On a machine after the change (has losetup issue as described above):
# cat /sys/module/loop/parameters/max_loop
8
# uname -r
5.15.0-69-generic

So it looks like the default changed and the max amount of loop devices
that can be created with mknod (not loop-control) is 8. If we set
max_loop=0 on the kernel command line, it works as before. Cannot unload
and reload module on a running system to change the parameter because it
is built into the kernel.

Another workaround is to use `losetup --find` but that means you cannot
create with named devices created with mknod.

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: New

-- 
losetup with mknod fails on jammy with kernel 5.15.0-69-generic
https://bugs.launchpad.net/bugs/2015400
You received this bug notification because you are a member of Kernel Packages, 
which is subscribed to linux in Ubuntu.

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to