]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
losetup: Fix setting of sizelimit on new loop devices
authorDaniel Drake <dsd@laptop.org>
Fri, 9 Mar 2012 17:56:50 +0000 (17:56 +0000)
committerKarel Zak <kzak@redhat.com>
Tue, 13 Mar 2012 11:21:49 +0000 (12:21 +0100)
"losetup --offset 10 --sizelimit 20 foo.img" was producing
a loop device with offset 20 and no sizelimit. Looks like a typo,
fix it.

Signed-off-by: Daniel Drake <dsd@laptop.org>
sys-utils/losetup.c

index 16ace6f968d84d76ebd03130300c288abdbbc245..9f031517c737cc3fb8495499b295ee13257ddd11 100644 (file)
@@ -362,7 +362,7 @@ int main(int argc, char **argv)
                        if (flags & LOOPDEV_FL_OFFSET)
                                loopcxt_set_offset(&lc, offset);
                        if (flags & LOOPDEV_FL_SIZELIMIT)
-                               loopcxt_set_offset(&lc, sizelimit);
+                               loopcxt_set_sizelimit(&lc, sizelimit);
                        if (lo_flags)
                                loopcxt_set_flags(&lc, lo_flags);
                        if ((res = loopcxt_set_backing_file(&lc, file))) {