Skip to contentSkip to conversation

Set JBD2_FEATURE_INCOMPAT_64BIT on filesystems larger than 32-bit blocks

PATCH In review Jose R. Santos 2 participants 3 messages Jun 6, 2007 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Set JBD2_FEATURE_INCOMPAT_64BIT on filesystems larger than 32-bit blocks

Set the journals JBD2_FEATURE_INCOMPAT_64BIT on devices with more than 32bit block sizes during mount time. This ensure proper record lenth when writing to the journal.

---
 fs/ext4/super.c |   11 +++++++++++
 1 file changed, 11 insertions(+)
fs/ext4/super.c +7 -0
Index: linux-2.6.22-rc3/fs/ext4/super.c
===================================================================
@@ -1824,6 +1824,13 @@ static int ext4_fill_super (struct super
 		goto failed_mount3;
 	}
 
+	if (ext4_blocks_count(es) > 0xffffffff &&
+	    !jbd2_journal_set_features(EXT4_SB(sb)->s_journal, 0, 0,
+				       JBD2_FEATURE_INCOMPAT_64BIT)) {
+		printk(KERN_ERR "ext4: Failed to set 64-bit journal feature\n");
+		goto failed_mount4;
+	}
+
 	/* We have now updated the journal if required, so we can
 	 * validate the data journaling mode. */
 	switch (test_opt(sb, DATA_FLAGS)) {

-JRS

#1 lore raw
Quoted 16 lines · Jose R. Santos

Set the journals JBD2_FEATURE_INCOMPAT_64BIT on devices with more than 32bit block sizes during mount time. This ensure proper record lenth when writing to the journal.

---
 fs/ext4/super.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

Index: linux-2.6.22-rc3/fs/ext4/super.c
===================================================================

fs/ext4/super.c static int ext4_fill_super (struct super · line 1827

Quoted 4 lines
fs/ext4/super.c +1 -0
@@ -1824,6 +1824,13 @@ static int ext4_fill_super (struct super
 		goto failed_mount3;
 	}
 
+	if (ext4_blocks_count(es) > 0xffffffff &&

Perhaps you should use 0xffffffffULL ?

fs/ext4/super.c static int ext4_fill_super (struct super · line 1836

Quoted 9 lines
fs/ext4/super.c +6 -0
+	    !jbd2_journal_set_features(EXT4_SB(sb)->s_journal, 0, 0,
+				       JBD2_FEATURE_INCOMPAT_64BIT)) {
+		printk(KERN_ERR "ext4: Failed to set 64-bit journal feature\n");
+		goto failed_mount4;
+	}
+
 	/* We have now updated the journal if required, so we can
 	 * validate the data journaling mode. */
 	switch (test_opt(sb, DATA_FLAGS)) {

Regards,
Laurent

Signature · 3 lines
------------- [email protected]  --------------
       "Any sufficiently advanced technology is
  indistinguishable from magic." - Arthur C. Clarke
#2 lore raw
Quoted 20 lines · On Wed, 06 Jun 2007 09:56:10 +0200 Laurent Vivier <[email protected]>…
Quoted 19 lines · Jose R. Santos

Set the journals JBD2_FEATURE_INCOMPAT_64BIT on devices with more than 32bit block sizes during mount time. This ensure proper record lenth when writing to the journal.

---
 fs/ext4/super.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

Index: linux-2.6.22-rc3/fs/ext4/super.c
===================================================================

fs/ext4/super.c +0 -0
@@ -1824,6 +1824,13 @@ static int ext4_fill_super (struct super
 		goto failed_mount3;
 	}
 
Quoted 3 lines

fs/ext4/super.c static int ext4_fill_super (struct super · line 1827

Quoted 1 line
fs/ext4/super.c +1 -0
+	if (ext4_blocks_count(es) > 0xffffffff &&

Perhaps you should use 0xffffffffULL ?

Ah yes... Thanks for pointing that out.

I will make that change and add you to the Signed-off-by list if its OK with you.

Thanks

-JRS