Skip to contentSkip to conversation

mke2fs: make "invalid blocks count" error more clear

PATCH Applied Eric Sandeen 2 participants 2 messages Aug 12, 2010 – Sep 20, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mke2fs: make "invalid blocks count" error more clear

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)

---

misc/mke2fs.c +3 -2
index add7c0c..a34c1ba 100644
@@ -1415,8 +1415,9 @@ static void PRS(int argc, char *argv[])
 		fs_blocks_count = parse_num_blocks2(argv[optind++],
 						   fs_param.s_log_block_size);
 		if (!fs_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);
 		}
 	}
Applied
#1 lore raw
Quoted 5 lines · Eric Sandeen

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
Quoted 8 lines

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)

Applied to the e2fsprogs maint branch, thanks!!

- Ted