]> err.no Git - util-linux/commitdiff
losetup: remove dependence on minor numbers
authorKarel Zak <kzak@redhat.com>
Thu, 21 Aug 2008 10:06:25 +0000 (12:06 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 21 Aug 2008 10:06:25 +0000 (12:06 +0200)
The latest kernel supports partitioned loop devices (kernel commit
476a4813cfddf7cf159956cc0e2d3c830c1507e3). Unfortunately, this change
makes minor numbers useless, because mirror number does not match with
loop device name (loop<N>).

We have to follow loop device names only.

Signed-off-by: Karel Zak <kzak@redhat.com>
mount/lomount.c

index 5cf50f8841c9e418e0fdcd6280c3d713c4ea2b10..6ef143ab66df2a82a949aecbdd42960e8682d854 100644 (file)
@@ -301,6 +301,10 @@ looplist_next(struct looplist *ll)
                                continue;
                        if (m != LOOPMAJOR)
                                continue;
+                       /* unfortunately, real minor numbers needn't to match
+                        * loop<N> device name. We have to follow device name.
+                        */
+                       n = name2minor(1, name);
                        fd = looplist_open_dev(ll, n);
                        if (fd != -1)
                                return fd;