]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
resize2fs (libe2p): Fix resize2fs parsing of size parameter (in sector units)
authorTheodore Ts'o <tytso@mit.edu>
Mon, 2 Apr 2007 23:12:17 +0000 (19:12 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 2 Apr 2007 23:12:17 +0000 (19:12 -0400)
This was actually a bug in libe2p's parse_num_blocks() function.  When
handling the 's' suffix, it was ignoring the blocksize information
passed in from the caller and always interpreting the number in terms of
a 1k blocksize.

Addresses Debian Bug: #408298

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/e2p/ChangeLog
lib/e2p/parse_num.c

index 557bdfd881581d2457162434d8eaf6b048db9f3e..dc5d04f7fb359b8e74be939ff70f199a60b96ec7 100644 (file)
@@ -1,3 +1,10 @@
+2007-04-02  Theodore Tso  <tytso@mit.edu>
+
+       * parse_num.c (parse_num_blocks): When parsing the 's' prefix,
+               take into account the filesystem blocksize so we return
+               the correct answer for non-1k blocksize filesystems.
+               (Addresses Debian Bug: #408298)
+
 2007-03-21  Theodore Tso  <tytso@mit.edu>
 
        * feature.c (e2p_edit_feature), mntopts.c (e2p_edit_mntopts): Fix
index 3910e70de5d896bc47297b1901dead3cba0c575e..7e9ee71a4f68de599b04de320a4e000d82b5885f 100644 (file)
@@ -32,7 +32,7 @@ unsigned long parse_num_blocks(const char *arg, int log_block_size)
                num >>= log_block_size; 
                break;
        case 's': 
-               num >>= 1;
+               num >>= (1+log_block_size);
                break;
        case '\0':
                break;