Re: losetup: failed to setup loop device > 1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/08/2014 11:44 AM, Karel Zak wrote:
> On Wed, Oct 08, 2014 at 10:57:25AM +0200, Francis Moreau wrote:
>> In HEAD of the git tree, in file losetup.c, the return value of
>> loopcxt_add_device() is not checked in main().
>>
>> Is this expected ?
> 
> Good question :-)
> 

At least one ;)

> The loop-control is optional (from the code point of view). If the system 
> does not have control file (old kernels) and on command line specified loop
> device does not exist then it will end with open() error later
> (in loopcxt_setup_device()).
> 

in losetup.c, line 638:

		if (hasdev && !is_loopdev(loopcxt_get_device(&lc)))
			loopcxt_add_device(&lc);

I don't really see why having loop-control here or not matter: in both
case you want to stop if loopcxt_add_device() fails, no ?

If it fails then the loop device node, doesn't exist.

Thanks
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux