From 4e40f6c348b9c9f4bd9c82c2b5404c2eabbdc1d3 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 27 Jul 2001 23:33:40 -0400 Subject: [PATCH] mkjournal.c (ext2fs_create_journal_superblock): Set the first block usable in the journal for external journals to be 2 or 3, depending on the blocksize, so that the existing kernel code does the right thing. --- lib/ext2fs/ChangeLog | 5 +++++ lib/ext2fs/mkjournal.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 25c3a1b..9005688 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,5 +1,10 @@ 2001-07-27 Theodore Tso + * mkjournal.c (ext2fs_create_journal_superblock): Set the first + block usable in the journal for external journals to be 2 + or 3, depending on the blocksize, so that the existing + kernel code does the right thing. + * getsize.c (ext2fs_get_device_size): Add support for the BLKGETSIZE64 ioctl. (Ioctl defined by unofficial patches from Ben LaHaise, but it's likely this interface won't diff --git a/lib/ext2fs/mkjournal.c b/lib/ext2fs/mkjournal.c index c848e94..1ba30b2 100644 --- a/lib/ext2fs/mkjournal.c +++ b/lib/ext2fs/mkjournal.c @@ -72,8 +72,13 @@ errcode_t ext2fs_create_journal_superblock(ext2_filsys fs, * adjust these fields. */ if (fs->super->s_feature_incompat & - EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) + EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) { jsb->s_nr_users = 0; + if (fs->blocksize == 1024) + jsb->s_first = htonl(3); + else + jsb->s_first = htonl(2); + } *ret_jsb = (char *) jsb; return 0; -- 1.8.3.1