Fix e2fsck and mke2fs -c to be pass the last _block change to badblocks
Badblocks now interprets last_block argument as the last block to check,
instead of the number of blocks to check, to be consistent with the
badblocks man page.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index b83aac1..64e1a47 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -191,7 +191,7 @@
sprintf(buf, "badblocks -b %d -X %s%s%s %u", fs->blocksize,
quiet ? "" : "-s ", (cflag > 1) ? "-w " : "",
- fs->device_name, fs->super->s_blocks_count);
+ fs->device_name, fs->super->s_blocks_count-1);
if (verbose)
printf(_("Running command: %s\n"), buf);
f = popen(buf, "r");