dumpe2fs: complain if extra arguments are given on the command line
PATCH 1/5 dumpe2fs: complain if extra arguments are given on the command line
Addresses-Debian-Bug: #758074
--- misc/dumpe2fs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
misc/dumpe2fs.c +3 -1
@@ -575,8 +575,10 @@ int main (int argc, char ** argv)usage (); } } -if (optind > argc -1 ) +if (argc -1 > optind) {usage (); +exit (1 ); + } device_name = argv[optind++]; flags =EXT2_FLAG_JOURNAL_DEV_OK |EXT2_FLAG_SOFTSUPP_FEATURES |EXT2_FLAG_64BITS ;if (force)
Signature · 1 line
2.1.0
PATCH 2/5 resize2fs.8.in: clarify when on-line resizing is supported
Addresses-Debian-Bug: #726760
--- resize/resize2fs.8.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
resize/resize2fs.8.in +4 -3
@@ -29,9 +29,10 @@ program will resize ext2, ext3, or ext4 file systems. It can be used to enlarge or shrink an unmounted file system located on .IR device . If the filesystem is mounted, it can be used to expand the size of the -mounted filesystem, assuming the kernel supports on-line resizing. (As -of this writing, the Linux 2.6 kernel supports on-line resize for -filesystems mounted using ext3 and ext4.). +mounted filesystem, assuming the kernel and the file system supports +on-line resizing. (Modern Linux 2.6 kernels will support on-line resize +for file systems mounted using ext3 and ext4; ext3 file systems will +require the use of file systems with the resize_inode feature enabled.) .PP The .I size
Signature · 1 line
2.1.0
PATCH 3/5 resize2fs: clarify the size of blocks in resize2fs's messages
In reply to Theodore Ts'oAddresses-Debian-Bug: #758029
--- resize/main.c | 9 +++++---- tests/r_inline_xattr/expect | 2 +- tests/r_min_itable/expect | 2 +- tests/r_move_itable/expect | 8 ++++---- tests/r_resize_inode/expect | 6 +++--- 5 files changed, 14 insertions(+), 13 deletions(-)
resize/main.c +5 -4
@@ -441,8 +441,9 @@ int main (int argc, char ** argv)exit (1 ); }if (new_size ==ext2fs_blocks_count (fs->super)) { -fprintf (stderr,_ ("The filesystem is already %llu blocks " -"long. Nothing to do!\n\n" ), new_size); +fprintf (stderr,_ ("The filesystem is already %llu (%dk) " +"blocks long. Nothing to do!\n\n" ), new_size, + fs->blocksize /1024 );exit (0 ); }if (mount_flags &EXT2_MF_MOUNTED ) {
@@ -468,8 +469,8 @@ int main (int argc, char ** argv)ext2fs_close_free (&fs);exit (1 ); } -printf (_ ("The filesystem on %s is now %llu blocks long.\n\n" ), - device_name, new_size); +printf (_ ("The filesystem on %s is now %llu (%dk) blocks long.\n\n" ), + device_name, new_size, fs->blocksize /1024 );if ((st_buf.st_size > new_file_size) && (fd >0 )) {
tests/r_inline_xattr/expect +1 -1
@@ -6,7 +6,7 @@ Extended attributes stored in inode body: Exit status is 0 resize2fs test.img 5M Resizing the filesystem on test.img to 5120 (1k) blocks. -The filesystem on test.img is now 5120 blocks long. +The filesystem on test.img is now 5120 (1k) blocks long. Exit status is 0 debugfs -R ''stat file'' test.img 2>&1 | grep ''^Inode\|in inode body\|name = ''
tests/r_min_itable/expect +1 -1
@@ -1,7 +1,7 @@ resize2fs test resize2fs -M test.img Resizing the filesystem on test.img to 1124 (1k) blocks. -The filesystem on test.img is now 1124 blocks long. +The filesystem on test.img is now 1124 (1k) blocks long. Exit status is 0
tests/r_move_itable/expect +4 -4
@@ -3,7 +3,7 @@ resize2fs -p test.img 10000 Resizing the filesystem on test.img to 10000 (1k) blocks. Begin pass 1 (max = 35) Extending the inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -The filesystem on test.img is now 9985 blocks long. +The filesystem on test.img is now 9985 (1k) blocks long. Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure
@@ -299,7 +299,7 @@ resize2fs -p test.img 20000 Resizing the filesystem on test.img to 20000 (1k) blocks. Begin pass 1 (max = 39) Extending the inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -The filesystem on test.img is now 19969 blocks long. +The filesystem on test.img is now 19969 (1k) blocks long. Filesystem did not have a UUID; generating one.
@@ -833,7 +833,7 @@ resize2fs -p test.img 30000 Resizing the filesystem on test.img to 30000 (1k) blocks. Begin pass 1 (max = 39) Extending the inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -The filesystem on test.img is now 29953 blocks long. +The filesystem on test.img is now 29953 (1k) blocks long. Filesystem did not have a UUID; generating one.
@@ -1603,7 +1603,7 @@ resize2fs -p test.img 40000 Resizing the filesystem on test.img to 40000 (1k) blocks. Begin pass 1 (max = 40) Extending the inode table ----------------------------------------XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -The filesystem on test.img is now 40000 blocks long. +The filesystem on test.img is now 40000 (1k) blocks long. Filesystem did not have a UUID; generating one.
tests/r_resize_inode/expect +3 -3
@@ -1,7 +1,7 @@ mke2fs -q -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 16384 resize2fs test.img 65536 Resizing the filesystem on test.img to 65536 (1k) blocks. -The filesystem on test.img is now 65536 blocks long. +The filesystem on test.img is now 65536 (1k) blocks long. Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure
@@ -448,7 +448,7 @@ Group 63: (Blocks 64513-65535) mke2fs -q -F -O resize_inode -o Linux -b 1024 -g 1024 test.img 65536 resize2fs test.img 16384 Resizing the filesystem on test.img to 16384 (1k) blocks. -The filesystem on test.img is now 16384 blocks long. +The filesystem on test.img is now 16384 (1k) blocks long. Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure
@@ -600,7 +600,7 @@ Group 15: (Blocks 15361-16383) -------------------------------- resize2fs test.img 165536 Resizing the filesystem on test.img to 165536 (1k) blocks. -The filesystem on test.img is now 165536 blocks long. +The filesystem on test.img is now 165536 (1k) blocks long. Filesystem did not have a UUID; generating one.
Signature · 1 line
2.1.0
PATCH 4/5 mke2fs.8.in: explain how the fs-size parameter is interpreted
In reply to Theodore Ts'o--- misc/mke2fs.8.in | 53 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 12 deletions(-)
misc/mke2fs.8.in +41 -12
@@ -111,7 +111,7 @@ mke2fs \- create an ext2/ext3/ext4 filesystem ] .I device [ -.I blocks-count +.I fs-size ] @[email protected] @[email protected] "mke2fs \-O journal_dev"
@@ -139,23 +139,52 @@ mke2fs \- create an ext2/ext3/ext4 filesystem @JDEV@] @[email protected] external-journal @JDEV@[ -@[email protected] blocks-count +@[email protected] fs-size @JDEV@] .SH DESCRIPTION .B mke2fs is used to create an ext2, ext3, or ext4 filesystem, usually in a disk -partition. -.I device -is the special file corresponding to the device (e.g -.IR /dev/hdXX ). -.I blocks-count -is the number of blocks on the device. If omitted, +partition (or file) named by +.IR device . +.PP +The file system size is specified by +.IR fs-size . +If +.I fs-size +does not have a suffix, it is interpreted as power-of-two kilobytes, +unless the +.B \-b +.I blocksize +option is specified, in which case +.I fs-size +is interpreted as the number of +.I blocksize +blocks. If the fs-size is suffixed by 'k', 'm', 'g', 't' +(either upper-case or lower-case), then it is interpreted in +power-of-two kilobytes, megabytes, gigabytes, terabytes, etc. +If +.I fs-size +is omitted, .B mke2fs -automagically figures the file system size. If called as +will create the file system based on the device size. +.PP +If +.B mke2fs +is run as +.B mkfs.XXX +(i.e., +.BR mkfs.ext2 , +.BR mkfs.ext3 , +or +.BR mkfs.ext4 ) +the option +.B \-t +.I XXX +is implied; so .B mkfs.ext3 -a journal is created as if the -.B \-j -option was specified. +will create a file system for use with ext3, +.B mkfs.ext4 +will create a file system for use with ext4, and so on. .PP The defaults of the parameters for the newly created filesystem, if not overridden by the options listed below, are controlled by the
Signature · 1 line
2.1.0
PATCH 5/5 mke2fs: improve the error message when a non-existent file is specified
In reply to Theodore Ts'oIf the user does not specify the file system size, and the file does not exist, give an error message like this:
The file /tmp/foo.img does not exist and no size was specified.
instead of this:
Creating regular file /tmp/foo.img
mke2fs: Device size reported to be zero. Invalid partition specified, or
partition table wasn't reread after running fdisk, due to a modified partition being busy and in use. You may need to reboot to re-read your partition table.
--- misc/mke2fs.c | 2 ++ misc/util.c | 5 +++++ misc/util.h | 1 + 3 files changed, 8 insertions(+)
misc/mke2fs.c +2 -0
@@ -1796,6 +1796,8 @@ profile_error: flags |=CHECK_FS_EXIST ;if (!quiet) flags |=VERBOSE_CREATE ; +if (fs_blocks_count ==0 ) + flags |=NO_SIZE ;if (!check_plausibility (device_name, flags, &is_device) && !force)proceed_question (proceed_delay);
misc/util.c +5 -0
@@ -198,6 +198,11 @@ int check_plausibility(const char *device, int flags, int *ret_is_dev)char *fs_label =NULL ; fd =ext2fs_open_file (device, fl,0666 ); +if ((fd <0 ) && (errno ==ENOENT ) && (flags &NO_SIZE )) { +fprintf (stderr,_ ("The file %s does not exist and no " +"size was specified.\n" ), device); +exit (1 ); + }if ((fd <0 ) && (errno ==ENOENT ) && (flags &CREATE_FILE )) { fl |=O_CREAT ; fd =ext2fs_open_file (device, fl,0666 );
misc/util.h +1 -0
@@ -22,6 +22,7 @@ extern char *journal_location_string;#define CREATE_FILE 0x0002#define CHECK_FS_EXIST 0x0004#define VERBOSE_CREATE 0x0008 +#define NO_SIZE 0x0010#ifndef HAVE_STRCASECMP extern int strcasecmp (char *s1,char *s2);
Signature · 1 line
2.1.0