diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-05-10 16:57:31 -0400 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2009-05-27 10:23:26 +0200 |
commit | 83277bc95a84f325d5f3dab3babf2998dc8b4555 (patch) | |
tree | 1820fc6c6fdbf643476a5ad20fa5602c48a46386 /mount/lomount.c | |
parent | 28f0c63388ab7eeeb0953355dc4ff2edc5afe9e8 (diff) | |
download | util-linux-old-83277bc95a84f325d5f3dab3babf2998dc8b4555.tar.gz |
losetup: handle symlinks in /dev/loop/
The loop_scandir() expects all the files in /dev/loop/ to be actual
devices and not symlinks to devices. However, udev by default sets up
symlinks in /dev/loop/ thereby breaking the fallback scan logic when
looking for devices more than the default number of 8.
Simple way to reproduce is:
- <detach all devices>
- cd /dev/loop
- rm -f [2-7]
- losetup 0 autogen.sh
- mv 1 8
- for n in {1..7} ; do ln -s 0 $n ; done
- losetup -f
<error but should have found /dev/loop/8>
[kay.sievers@vrfy.org:
just a note, udev does not do that by default. It is
devfs-nonsense, which the "default" never did.]
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reported-by: Mario Bachmann <grafgrimm77@gmx.de>
Diffstat (limited to 'mount/lomount.c')
-rw-r--r-- | mount/lomount.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mount/lomount.c b/mount/lomount.c index d62198ef..c173409e 100644 --- a/mount/lomount.c +++ b/mount/lomount.c @@ -256,7 +256,7 @@ loop_scandir(const char *dirname, int **ary, int hasprefix) *ary = NULL; while((d = readdir(dir))) { - if (d->d_type != DT_BLK && d->d_type != DT_UNKNOWN) + if (d->d_type != DT_BLK && d->d_type != DT_UNKNOWN && d->d_type != DT_LNK) continue; n = name2minor(hasprefix, d->d_name); if (n == -1 || n < NLOOPS_DEFAULT) |