Re: set_loop tries to create 1048575 loop devices

2014-01-21 Thread Ralf Friedl

Lauri Kasanen wrote:

On Mon, Jan 20, 2014, at 18:52, Ralf Friedl wrote:

Hi

I just had mount create a large number of loop devices before I
interrupted it.
The reason is that the loop module is not loaded in the kernel, but it
would be better to have an error message instead.
...

I don't know whether there are other reasons why open /dev/loop might
return ENXIO, but if not, then set_loop should abort when it receives
that error.

According to libbb/loop.c, it also returns ENXIO to mean this loop is
free. So can't exactly abort for that.

I recommend you disable ENABLE_FEATURE_MOUNT_LOOP_CREATE if you don't
want the devices created.
It's not that I don't want the loop functionality, it's just that the 
loop module was not loaded and trying to open /dev/loop0 didn't trigger 
the module to be loaded.


Ralf
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: set_loop tries to create 1048575 loop devices

2014-01-21 Thread Denys Vlasenko
Yes, good idea.

Please try current git, I pushed a fix there.

On Mon, Jan 20, 2014 at 5:52 PM, Ralf Friedl ralf.fri...@online.de wrote:
 Hi

 I just had mount create a large number of loop devices before I interrupted
 it.
 The reason is that the loop module is not loaded in the kernel, but it would
 be better to have an error message instead.

 Here ist the strace output:
 stat64(/dev/loop0, 0x7ffd8840)= -1 ENOENT (No such file or
 directory)
 mknod(/dev/loop0, S_IFBLK|0644, makedev(7, 0)) = 0
 open(/dev/loop0, O_RDONLY|O_LARGEFILE) = -1 ENXIO (No such device or
 address)
 stat64(/dev/loop1, 0x7ffd8840)= -1 ENOENT (No such file or
 directory)
 mknod(/dev/loop1, S_IFBLK|0644, makedev(7, 1)) = 0
 open(/dev/loop1, O_RDONLY|O_LARGEFILE) = -1 ENXIO (No such device or
 address)
 ...
 stat64(/dev/loop255, 0x7ffd8840)  = -1 ENOENT (No such file or
 directory)
 mknod(/dev/loop255, S_IFBLK|0644, makedev(7, 255)) = 0
 open(/dev/loop255, O_RDONLY|O_LARGEFILE) = -1 ENXIO (No such device or
 address)
 stat64(/dev/loop256, 0x7ffd8840)  = -1 ENOENT (No such file or
 directory)
 mknod(/dev/loop256, S_IFBLK|0644, makedev(7, 0)) = 0
 open(/dev/loop256, O_RDONLY|O_LARGEFILE) = -1 ENXIO (No such device or
 address)
 ...

 I don't know whether there are other reasons why open /dev/loop might return
 ENXIO, but if not, then set_loop should abort when it receives that error.

 Regards
 Ralf
 ___
 busybox mailing list
 busybox@busybox.net
 http://lists.busybox.net/mailman/listinfo/busybox
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: set_loop tries to create 1048575 loop devices

2014-01-21 Thread Ralf Friedl

Denys Vlasenko schrieb:

Yes, good idea.

Please try current git, I pushed a fix there.

Works very well, thank you.

Ralf
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


set_loop tries to create 1048575 loop devices

2014-01-20 Thread Ralf Friedl

Hi

I just had mount create a large number of loop devices before I 
interrupted it.
The reason is that the loop module is not loaded in the kernel, but it 
would be better to have an error message instead.


Here ist the strace output:
stat64(/dev/loop0, 0x7ffd8840)= -1 ENOENT (No such file or 
directory)

mknod(/dev/loop0, S_IFBLK|0644, makedev(7, 0)) = 0
open(/dev/loop0, O_RDONLY|O_LARGEFILE) = -1 ENXIO (No such device or 
address)
stat64(/dev/loop1, 0x7ffd8840)= -1 ENOENT (No such file or 
directory)

mknod(/dev/loop1, S_IFBLK|0644, makedev(7, 1)) = 0
open(/dev/loop1, O_RDONLY|O_LARGEFILE) = -1 ENXIO (No such device or 
address)

...
stat64(/dev/loop255, 0x7ffd8840)  = -1 ENOENT (No such file or 
directory)

mknod(/dev/loop255, S_IFBLK|0644, makedev(7, 255)) = 0
open(/dev/loop255, O_RDONLY|O_LARGEFILE) = -1 ENXIO (No such device or 
address)
stat64(/dev/loop256, 0x7ffd8840)  = -1 ENOENT (No such file or 
directory)

mknod(/dev/loop256, S_IFBLK|0644, makedev(7, 0)) = 0
open(/dev/loop256, O_RDONLY|O_LARGEFILE) = -1 ENXIO (No such device or 
address)

...

I don't know whether there are other reasons why open /dev/loop might 
return ENXIO, but if not, then set_loop should abort when it receives 
that error.


Regards
Ralf
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: set_loop tries to create 1048575 loop devices

2014-01-20 Thread Lauri Kasanen


On Mon, Jan 20, 2014, at 18:52, Ralf Friedl wrote:
 Hi
 
 I just had mount create a large number of loop devices before I 
 interrupted it.
 The reason is that the loop module is not loaded in the kernel, but it 
 would be better to have an error message instead.
 ...
 
 I don't know whether there are other reasons why open /dev/loop might 
 return ENXIO, but if not, then set_loop should abort when it receives 
 that error.

According to libbb/loop.c, it also returns ENXIO to mean this loop is
free. So can't exactly abort for that.

I recommend you disable ENABLE_FEATURE_MOUNT_LOOP_CREATE if you don't
want the devices created.

- Lauri

-- 
http://www.fastmail.fm - Same, same, but different...

___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: set_loop tries to create 1048575 loop devices

2014-01-20 Thread Lauri Kasanen
  I just had mount create a large number of loop devices before I 
  interrupted it.
  The reason is that the loop module is not loaded in the kernel, but it 
  would be better to have an error message instead.
  ...
  
  I don't know whether there are other reasons why open /dev/loop might 
  return ENXIO, but if not, then set_loop should abort when it receives 
  that error.
 
 According to libbb/loop.c, it also returns ENXIO to mean this loop is
 free. So can't exactly abort for that.
 
 I recommend you disable ENABLE_FEATURE_MOUNT_LOOP_CREATE if you don't
 want the devices created.

My mistake, the ENXIO was from ioctl not open. Checking for it in open
should be ok.

- Lauri

-- 
http://www.fastmail.fm - IMAP accessible web-mail

___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox