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.
diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog
index 886f73a..c22cec8 100644
--- a/lib/ext2fs/ChangeLog
+++ b/lib/ext2fs/ChangeLog
@@ -1,3 +1,10 @@
+2001-02-07 Theodore Tso <tytso@valinux.com>
+
+ * 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 <tytso@valinux.com>
* mkjournal.c (ext2fs_add_journal_device): Fix bug where the
diff --git a/lib/ext2fs/mkjournal.c b/lib/ext2fs/mkjournal.c
index 52b7998..62a4575 100644
--- a/lib/ext2fs/mkjournal.c
+++ b/lib/ext2fs/mkjournal.c
@@ -62,18 +62,18 @@
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;