Skip to contentSkip to conversation

ext3 fill_super reporting

PATCH In review FabF 2 participants 2 messages Jun 19, 2004

lore
Share & tools
lore

FabF

author
#0 lore raw

PATCH 1/1 ext3 fill_super reporting

Andrew,

This patch does the following :
-Explicit max_per_group authorized for block, fragments, inodes -Remove groupmax recalculations
-When mounting ext2 or ^has_journal , we know filesystem is extX
relevant.

btw, I see a FIXME in journal_update for new journal creation.Does it
mean we should patch to have e.g. journalupdate=<filename> or that note is obsolete ?

Regards,
FabF

fs/ext3/super.c +19 -11
diff -Naur orig/fs/ext3/super.c edited/fs/ext3/super.c
@@ -1209,6 +1209,7 @@
 	unsigned long offset = 0;
 	unsigned long journal_inum = 0;
 	unsigned long def_mount_opts;
+	unsigned long max_per_group;
 	struct inode *root;
 	int blocksize;
 	int hblock;
@@ -1397,26 +1398,31 @@
 	sbi->s_mount_state = le16_to_cpu(es->s_state);
 	sbi->s_addr_per_block_bits = log2(EXT3_ADDR_PER_BLOCK(sb));
 	sbi->s_desc_per_block_bits = log2(EXT3_DESC_PER_BLOCK(sb));
-	for (i=0; i < 4; i++)
+
+	for (i = 0; i < 4; i++)
 		sbi->s_hash_seed[i] = le32_to_cpu(es->s_hash_seed[i]);
 	sbi->s_def_hash_version = es->s_def_hash_version;
+	max_per_group = blocksize * 8;
 
-	if (sbi->s_blocks_per_group > blocksize * 8) {
+	if (sbi->s_blocks_per_group > max_per_group) {
 		printk (KERN_ERR
-			"EXT3-fs: #blocks per group too big: %lu\n",
-			sbi->s_blocks_per_group);
+			"EXT3-fs: #blocks per group too big: %lu"
+			" (maximum : %lu)\n",
+			sbi->s_blocks_per_group, max_per_group);
 		goto failed_mount;
 	}
-	if (sbi->s_frags_per_group > blocksize * 8) {
+	if (sbi->s_frags_per_group > max_per_group) {
 		printk (KERN_ERR
-			"EXT3-fs: #fragments per group too big: %lu\n",
-			sbi->s_frags_per_group);
+			"EXT3-fs: #fragments per group too big: %lu"
+			" (maximum : %lu)\n",
+			sbi->s_frags_per_group, max_per_group);
 		goto failed_mount;
 	}
-	if (sbi->s_inodes_per_group > blocksize * 8) {
+	if (sbi->s_inodes_per_group > max_per_group) {
 		printk (KERN_ERR
-			"EXT3-fs: #inodes per group too big: %lu\n",
-			sbi->s_inodes_per_group);
+			"EXT3-fs: #inodes per group too big: %lu"
+			" (maximum : %lu)\n",
+			sbi->s_inodes_per_group, max_per_group);
 		goto failed_mount;
 	}
 
@@ -1491,9 +1497,11 @@
 		if (ext3_create_journal(sb, es, journal_inum))
 			goto failed_mount2;
 	} else {
+		/* ext3 won't run without journal */
 		if (!silent)
 			printk (KERN_ERR
-				"ext3: No journal on filesystem on %s\n",
+				"EXT3-fs: No journal in filesystem on %s"
+				" : a ^has_journal ext3 or ext2 partition\n",
 				sb->s_id);
 		goto failed_mount2;
 	}
#1 lore raw
Quoted 6 lines · FabF

Andrew,

This patch does the following :

-Explicit max_per_group authorized for block, fragments, inodes

Sorry, but this is just too trivial to be worth the processing. The compiler is perfectly capable of retaining the `blocksize * 8' result for later use and this part of your patch actually increases the code size slightly.

Quoted 1 line

-Remove groupmax recalculations

I don't know what this means.

Quoted 5 lines

-When mounting ext2 or ^has_journal , we know filesystem is extX
relevant.

btw, I see a FIXME in journal_update for new journal creation.

There is no such thing as journal_update. I assume you're referring to the handling of the "journal=update" mount option. Please be more careful when identifying these things.

Quoted 3 lines

Does it
mean we should patch to have e.g. journalupdate=<filename> or that note is obsolete ?

No, I see no need to be able to convert an ext2 filesystem to ext3 within the kernel. Nobody will bother to work on this.