From d23042af75f2723ed4575946cfa310fca4e526ef Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 8 Feb 2001 03:37:16 +0000 Subject: [PATCH] ChangeLog, mkjournal.c: mkjournal.c (ext2fs_create_journal_superblock): Fix the setting of s_first for external devices to always be 1, since jsb->s_first is always relative to the start of the journal superblock. Use htonl(1) when setting s_nr_users. --- lib/ext2fs/ChangeLog | 7 +++++++ lib/ext2fs/mkjournal.c | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 886f73ab..c22cec83 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,3 +1,10 @@ +2001-02-07 Theodore Tso + + * mkjournal.c (ext2fs_create_journal_superblock): Fix the setting + of s_first for external devices to always be 1, since + jsb->s_first is always relative to the start of the + journal superblock. Use htonl(1) when setting s_nr_users. + 2001-01-17 Theodore Ts'o * mkjournal.c (ext2fs_add_journal_device): Fix bug where the diff --git a/lib/ext2fs/mkjournal.c b/lib/ext2fs/mkjournal.c index 52b7998d..62a45754 100644 --- a/lib/ext2fs/mkjournal.c +++ b/lib/ext2fs/mkjournal.c @@ -62,18 +62,18 @@ errcode_t ext2fs_create_journal_superblock(ext2_filsys fs, jsb->s_header.h_blocktype = htonl(JFS_SUPERBLOCK_V2); jsb->s_blocksize = htonl(fs->blocksize); jsb->s_maxlen = htonl(size); + jsb->s_nr_users = htonl(1); jsb->s_first = htonl(1); jsb->s_sequence = htonl(1); memcpy(jsb->s_uuid, fs->super->s_uuid, sizeof(fs->super->s_uuid)); - jsb->s_nr_users = 1; /* - * Now for the special settings if we're creating an external - * journal device + * If we're creating an external journal device, we need to + * adjust these fields. */ if (fs->super->s_feature_incompat & EXT3_FEATURE_INCOMPAT_JOURNAL_DEV) { jsb->s_nr_users = 0; - jsb->s_first = htonl(fs->super->s_first_data_block+2); + jsb->s_first = htonl(1); } *ret_jsb = (char *) jsb;