From 36131b37d7d37ad59153cc2c56f774e28e286acf Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 26 Jul 2001 23:44:39 -0400 Subject: [PATCH] mkjournal.c (ext2fs_add_journal_device): Use the correct block to find the journal superblock if the blocksize is 1024. --- lib/ext2fs/ChangeLog | 5 +++++ lib/ext2fs/mkjournal.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 76873a5..660c279 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,3 +1,8 @@ +2001-07-26 Theodore Tso + + * mkjournal.c (ext2fs_add_journal_device): Use the correct block + to find the journal superblock if the blocksize is 1024. + 2001-07-21 Theodore Tso * ext2_err.et.in (EXT2_ET_LOAD_EXT_JOURNAL): Add new error code diff --git a/lib/ext2fs/mkjournal.c b/lib/ext2fs/mkjournal.c index 8c722e6..ada11a6 100644 --- a/lib/ext2fs/mkjournal.c +++ b/lib/ext2fs/mkjournal.c @@ -250,7 +250,7 @@ errcode_t ext2fs_add_journal_device(ext2_filsys fs, ext2_filsys journal_dev) errcode_t retval; char buf[1024]; journal_superblock_t *jsb; - int i; + int i, start; __u32 nr_users; /* Make sure the device exists and is a block device */ @@ -261,7 +261,10 @@ errcode_t ext2fs_add_journal_device(ext2_filsys fs, ext2_filsys journal_dev) return EXT2_ET_JOURNAL_NOT_BLOCK; /* Must be a block device */ /* Get the journal superblock */ - if ((retval = io_channel_read_blk(journal_dev->io, 1, -1024, buf))) + start = 1; + if (journal_dev->blocksize == 1024) + start++; + if ((retval = io_channel_read_blk(journal_dev->io, start, -1024, buf))) return retval; jsb = (journal_superblock_t *) buf; -- 1.8.3.1