From 8ade4792307303e27386420f60bacf032ad73d5d Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Wed, 8 Nov 2006 00:41:50 -0500 Subject: [PATCH] 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" --- e2fsck/ChangeLog | 6 ++++++ e2fsck/badblocks.c | 2 +- misc/ChangeLog | 6 ++++++ misc/mke2fs.c | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 6b03532..ce80f5c 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,9 @@ +2006-11-08 Theodore Tso + + * badblocks.c (read_bad_blocks_file): Change the last_block + argument passed to the badblocks program to be consistent + with the change to badblocks. + 2006-10-21 Theodore Tso * pass2.c (parse_int_node): Don't core dump if there is a corrupt diff --git a/e2fsck/badblocks.c b/e2fsck/badblocks.c index 68c320b..36dc208 100644 --- a/e2fsck/badblocks.c +++ b/e2fsck/badblocks.c @@ -75,7 +75,7 @@ void read_bad_blocks_file(e2fsck_t ctx, const char *bad_blocks_file, sprintf(buf, "badblocks -b %d -X %s%s%s %d", fs->blocksize, (ctx->options & E2F_OPT_PREEN) ? "" : "-s ", (ctx->options & E2F_OPT_WRITECHECK) ? "-n " : "", - fs->device_name, fs->super->s_blocks_count); + fs->device_name, fs->super->s_blocks_count-1); f = popen(buf, "r"); if (!f) { com_err("read_bad_blocks_file", errno, diff --git a/misc/ChangeLog b/misc/ChangeLog index ed8d2fe..fb50257 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,9 @@ +2006-11-08 Theodore Tso + + * mke2fs.c (test_disk): Change the last_block argument passed to + the badblocks program to be consistent with the change to + badblocks. + 2006-10-18 Theodore Tso * mke2fs.c: Fix revision 0 error checking so that it doesn't give 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 @@ static void test_disk(ext2_filsys fs, badblocks_list *bb_list) 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"); -- 1.8.3.1