projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
351ef71
)
loop: correct minor device number limit
author
Denys Vlasenko
<vda.linux@googlemail.com>
Wed, 14 Apr 2010 20:52:41 +0000
(13:52 -0700)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Wed, 14 Apr 2010 20:52:41 +0000
(13:52 -0700)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/loop.c
patch
|
blob
|
history
diff --git
a/libbb/loop.c
b/libbb/loop.c
index 204fcc982bc94c197ad4619acd8d533d6053e40d..b69d9d96134cabc066f25ca5886ab8a72c04c81c 100644
(file)
--- a/
libbb/loop.c
+++ b/
libbb/loop.c
@@
-104,7
+104,8
@@
int FAST_FUNC set_loop(char **device, const char *file, unsigned long long offse
/* Find a loop device. */
try = *device ? *device : dev;
- for (i = 0; rc && i < 256; i++) {
+ /* 1048575 is a max possible minor number in Linux circa 2010 */
+ for (i = 0; rc && i < 1048576; i++) {
sprintf(dev, LOOP_FORMAT, i);
IF_FEATURE_MOUNT_LOOP_CREATE(errno = 0;)