Bug#408298: e2fsprogs: resize2fs doesn't honor s sector unit designator in size parameter

2007-04-02 Thread Theodore Tso
tags 408298 +pending
thanks

On Wed, Jan 24, 2007 at 09:20:58AM -0800, J.P. Larocque wrote:
 resize2fs isn't honoring the s unit designator.  Per resize2fs(8):

Thanks for the bug report!  It's been fixed in my sources and will be
in the next release of e2fsprogs.

Regards,

- Ted

# HG changeset patch
# User [EMAIL PROTECTED]
# Date 117537 14400
# Node ID d9af9856b9bfcde55566064b3f18c1d25d48b4e2
# Parent  08dedee691b5d2ed415cdb0105a29dbfded9b30d
resize2fs (libe2p): Fix resize2fs parsing of size parameter (in sector units)

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 [EMAIL PROTECTED]

diff -r 08dedee691b5 -r d9af9856b9bf lib/e2p/ChangeLog
--- a/lib/e2p/ChangeLog Mon Apr 02 18:42:59 2007 -0400
+++ b/lib/e2p/ChangeLog Mon Apr 02 19:12:17 2007 -0400
@@ -1,3 +1,10 @@ 2007-03-21  Theodore Tso  [EMAIL PROTECTED]
+2007-04-02  Theodore Tso  [EMAIL PROTECTED]
+
+   * 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  [EMAIL PROTECTED]
 
* feature.c (e2p_edit_feature), mntopts.c (e2p_edit_mntopts): Fix
diff -r 08dedee691b5 -r d9af9856b9bf lib/e2p/parse_num.c
--- a/lib/e2p/parse_num.c   Mon Apr 02 18:42:59 2007 -0400
+++ b/lib/e2p/parse_num.c   Mon Apr 02 19:12:17 2007 -0400
@@ -32,7 +32,7 @@ unsigned long parse_num_blocks(const cha
num = log_block_size; 
break;
case 's': 
-   num = 1;
+   num = (1+log_block_size);
break;
case '\0':
break;


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#408298: e2fsprogs: resize2fs doesn't honor s sector unit designator in size parameter

2007-01-24 Thread J.P. Larocque
Package: e2fsprogs
Version: 1.39+1.40-WIP-2006.11.14+dfsg-1
Severity: normal

resize2fs isn't honoring the s unit designator.  Per resize2fs(8):

The size parameter specifies the requested new size of the
filesystem.  If no units are specified, the units of the size
parameter shall be the filesystem blocksize of the filesystem.
Optionally, the size parameter may be suffixed by one of the
following the units designators: 's', 'K', 'M', or 'G', for 512
byte sectors, kilobytes, megabytes, or gigabytes, respectively.

In the test case documented below, it's treating the quantity as units
of 2048 bytes, not as units of 512 bytes.

$ touch test.ext2  /sbin/mke2fs -F -b 4096 test.ext2 4096
mke2fs 1.40-WIP (14-Nov-2006)
Filesystem label=
OS type: Linux  
Block size=4096 (log=2)
Fragment size=4096 (log=2)
4096 inodes, 4096 blocks
204 blocks (4.98%) reserved for the super user
First data block=0
1 block group   
32768 blocks per group, 32768 fragments per group
4096 inodes per group

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
$ /sbin/resize2fs test.ext2 65536s
resize2fs 1.40-WIP (14-Nov-2006)
Resizing the filesystem on test.ext2 to 32768 (4k) blocks.
The filesystem on test.ext2 is now 32768 blocks long.

$ ls -l test.ext2
-rw-r--r-- 1 piranha piranha 134217728 2007-01-24 08:37 test.ext2
$ nickle -e '134217728 / 512' # Calculate resulting sector count.
262144

-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-3-amd64
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages e2fsprogs depends on:
ii  e2fslibs 1.39+1.40-WIP-2006.11.14+dfsg-1 ext2 filesystem libraries
ii  libblkid 1.39+1.40-WIP-2006.11.14+dfsg-1 block device id library
ii  libc62.3.6.ds1-8 GNU C Library: Shared libraries
ii  libcomer 1.39+1.40-WIP-2006.11.14+dfsg-1 common error description library
ii  libss2   1.39+1.40-WIP-2006.11.14+dfsg-1 command-line interface parsing lib
ii  libuuid1 1.39+1.40-WIP-2006.11.14+dfsg-1 universally unique id library

e2fsprogs recommends no packages.

-- no debconf information

-- 
J.P. Larocque: [EMAIL PROTECTED], [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]