From f635d7f65bd002984ce9a202d491d4f187b996b2 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 9 May 1997 02:50:16 +0000 Subject: [PATCH] ChangeLog, mke2fs.c, badblocks.c: Pass the blocksize to the bad blocks command so that all of the filesystem gets tested in the case where the blocksize 2048 or 4096. ChangeLog, badblocks.c: Fix bug where ext2fs_badblocks_list_test would test the list (and exceed array boundaries) if there were no bad blocks on the bad blocks list. (Showed up when user tried: mke2fs -c -b 4096). --- e2fsck/ChangeLog | 6 ++++++ e2fsck/badblocks.c | 4 ++-- lib/ext2fs/ChangeLog | 7 +++++++ lib/ext2fs/badblocks.c | 3 +++ misc/ChangeLog | 6 ++++++ misc/mke2fs.c | 4 ++-- 6 files changed, 26 insertions(+), 4 deletions(-) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 82ec56bf..5c6348bc 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,9 @@ +Thu May 8 22:45:27 1997 Theodore Ts'o + + * badblocks.c (read_bad_blocks_file): Pass the blocksize to the + bad blocks command so that all of the filesystem gets + tested in the case where the blocksize 2048 or 4096. + Thu Apr 24 12:16:42 1997 Theodre Ts'o * Release of E2fsprogs version 1.10 diff --git a/e2fsck/badblocks.c b/e2fsck/badblocks.c index c81baae8..e6ab4bcc 100644 --- a/e2fsck/badblocks.c +++ b/e2fsck/badblocks.c @@ -71,8 +71,8 @@ void read_bad_blocks_file(ext2_filsys fs, const char *bad_blocks_file, fatal_error(0); } } else { - sprintf(buf, "badblocks %s%s %d", preen ? "" : "-s ", - fs->device_name, + sprintf(buf, "badblocks -b %d %s%s %d", fs->blocksize, + preen ? "" : "-s ", fs->device_name, fs->super->s_blocks_count); f = popen(buf, "r"); if (!f) { diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index d48c3059..f8fb703c 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,3 +1,10 @@ +Thu May 8 22:19:09 1997 Theodore Ts'o + + * badblocks.c (ext2fs_badblocks_list_test): Fix bug where + ext2fs_badblocks_list_test would test the list (and exceed + array boundaries) if there were no bad blocks on the bad + blocks list. (Showed up when user tried: mke2fs -c -b 4096). + Thu Apr 24 12:16:42 1997 Theodre Ts'o * Release of E2fsprogs version 1.10 diff --git a/lib/ext2fs/badblocks.c b/lib/ext2fs/badblocks.c index f8a562a5..25444f0a 100644 --- a/lib/ext2fs/badblocks.c +++ b/lib/ext2fs/badblocks.c @@ -131,6 +131,9 @@ int ext2fs_badblocks_list_test(ext2_badblocks_list bb, blk_t blk) if (bb->magic != EXT2_ET_MAGIC_BADBLOCKS_LIST) return 0; + if (bb->num == 0) + return 0; + low = 0; high = bb->num-1; if (blk == bb->list[low]) diff --git a/misc/ChangeLog b/misc/ChangeLog index 7ad397a8..b839560c 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,9 @@ +Thu May 8 22:22:08 1997 Theodore Ts'o + + * mke2fs.c (test_disk): Pass the blocksize to the bad blocks + command so that all of the filesystem gets tested in the + case where the blocksize 2048 or 4096. + Thu Apr 24 12:16:42 1997 Theodre Ts'o * Release of E2fsprogs version 1.10 diff --git a/misc/mke2fs.c b/misc/mke2fs.c index 55412466..99f0a211 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -203,8 +203,8 @@ static void test_disk(ext2_filsys fs, badblocks_list *bb_list) errcode_t retval; char buf[1024]; - sprintf(buf, "badblocks %s%s %d", quiet ? "" : "-s ", - fs->device_name, + sprintf(buf, "badblocks -b %d %s%s %d", fs->blocksize, + quiet ? "" : "-s ", fs->device_name, fs->super->s_blocks_count); if (verbose) printf("Running command: %s\n", buf); -- 2.11.0