Whamcloud - gitweb
mke2fs: make "invalid blocks count" error more clear
authorEric Sandeen <sandeen@redhat.com>
Thu, 12 Aug 2010 18:40:44 +0000 (14:40 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 20 Sep 2010 13:25:23 +0000 (09:25 -0400)
Mistakes on the commandline can lead to odd error messages:

# mke2fs -t ext4 -E stride=128 stripe-width=512 /dev/sda1
mke2fs: invalid blocks count - /dev/sda1

Making it a bit more explicit is more obvious:

mke2fs: invalid blocks count '/dev/sda1' on device 'stripe-width=512'

(hint, the mistake was no comma separation for -E)

Reported-by: Adam Huffman <bloch@verdurin.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/mke2fs.c

index 7c337a0..08fab41 100644 (file)
@@ -1462,8 +1462,9 @@ static void PRS(int argc, char *argv[])
                fs_param.s_blocks_count = parse_num_blocks(argv[optind++],
                                fs_param.s_log_block_size);
                if (!fs_param.s_blocks_count) {
-                       com_err(program_name, 0, _("invalid blocks count - %s"),
-                               argv[optind - 1]);
+                       com_err(program_name, 0,
+                               _("invalid blocks count '%s' on device '%s'"),
+                               argv[optind - 1], device_name);
                        exit(1);
                }
        }