Bug 1627 - losetup does not show loop devices beyond /dev/loop9
Summary: losetup does not show loop devices beyond /dev/loop9
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC Linux
: P3 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-24 09:10 UTC by mrother
Modified: 2010-05-18 22:41 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mrother 2010-04-24 09:10:26 UTC
Assuming one uses a non-trivial number of loop devices (e.g. > 10) any of the devices beyond '/dev/loop9' do not get reported when using 'losetup' to get a list of ALL (!!) loop devices that are currently in use.

Likewise if the next free loop device is beyond '/dev/loop9' nothing will be reported when using 'losetup -f' to find out the next free loop device.

I guess this bug is a consequence of the following code snippet from 'util-linux/losetup.c':
    if (++dev[sizeof(dev) - 2] > '9')
			break;
I have to admit that I have done no tests to confirm or deny this hunch. 

I'm a user of TinyCoreLinux, which relies on BusyBox to a large degree. Due to the heavy use of loop mounting a lot of loop devices can be in use and it's a pity that 'losetup' can't be used to the obtain proper information.