Skip to contentSkip to conversation

What is the history of CONFIG_EXT{2,3}_CHECK?

PATCH New Adrian Bunk 3 participants 4 messages Oct 31, 2005 – Nov 7, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Can anyone tell me the history of CONFIG_EXT{2,3}_CHECK?

There is code for a "check" option for mount if these options are enabled, but there's no way to enable them.

TIA
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#1 lore raw
Quoted 4 lines · Adrian Bunk

Can anyone tell me the history of CONFIG_EXT{2,3}_CHECK?

There is code for a "check" option for mount if these options are enabled, but there's no way to enable them.

These are expensive debugging options, which walk the inode/block bitmaps for getting the group inode/block usage instead of using the group summary data. Not used very often but I suspect occasionally useful for developers mucking with ext[23] internals. Since it is developer-only code it needs to be enabled with #define CONFIG_EXT[23]_CHECK in a header or compile option.

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.

#2 lore raw
Quoted 6 lines · Andreas Dilger
Quoted 4 lines · Adrian Bunk

Can anyone tell me the history of CONFIG_EXT{2,3}_CHECK?

There is code for a "check" option for mount if these options are enabled, but there's no way to enable them.

Quoted 6 lines

These are expensive debugging options, which walk the inode/block bitmaps for getting the group inode/block usage instead of using the group summary data. Not used very often but I suspect occasionally useful for developers mucking with ext[23] internals. Since it is developer-only code it needs to be enabled with #define CONFIG_EXT[23]_CHECK in a header or compile option.

It's basically a stripped down version of e2fsck pass #5, though. Is there any reason why this needs to be in the kernel? If it would be useful I could easily make a userspace implementation of these checks.

- Ted

#3 lore raw

PATCH 1/1 remove CONFIG_EXT{2,3}_CHECK

Quoted 14 lines · Theodore Ts'o
Quoted 6 lines · Andreas Dilger
Quoted 4 lines · Adrian Bunk

Can anyone tell me the history of CONFIG_EXT{2,3}_CHECK?

There is code for a "check" option for mount if these options are enabled, but there's no way to enable them.

Quoted 6 lines

These are expensive debugging options, which walk the inode/block bitmaps for getting the group inode/block usage instead of using the group summary data. Not used very often but I suspect occasionally useful for developers mucking with ext[23] internals. Since it is developer-only code it needs to be enabled with #define CONFIG_EXT[23]_CHECK in a header or compile option.

Quoted 3 lines

It's basically a stripped down version of e2fsck pass #5, though. Is there any reason why this needs to be in the kernel? If it would be useful I could easily make a userspace implementation of these checks.

This code was introduced with kernel 2.4, but as far as I can see there was never an option for enabling it.

Unless someone can give a strong reason for keeping it, I'd suggest the patch below.

Quoted 1 line

- Ted

cu
Adrian

<-- snip -->

The CONFIG_EXT{2,3}_CHECK options where were never available, and all they did was to implement a subset of e2fsck in the kernel.

---

 Documentation/filesystems/ext2.txt |    2 
 fs/ext2/balloc.c                   |   73 -----------------------------
 fs/ext2/ialloc.c                   |   40 ---------------
 fs/ext2/super.c                    |   16 ------
 fs/ext3/balloc.c                   |   73 -----------------------------
 fs/ext3/ialloc.c                   |   41 ----------------
 fs/ext3/super.c                    |   17 ------
 7 files changed, 2 insertions(+), 260 deletions(-)
Documentation/filesystems/ext2.txt renamed from Documentation/filesystems/ext2.txt.old +0 -2
@@ -17,8 +17,6 @@
 bsddf			(*)	Makes `df' act like BSD.
 minixdf				Makes `df' act like Minix.
 
-check				Check block and inode bitmaps at mount time
-				(requires CONFIG_EXT2_CHECK).
 check=none, nocheck	(*)	Don't do extra checking of bitmaps on mount
 				(check=normal and check=strict options removed)
 
fs/ext2/balloc.c renamed from fs/ext2/balloc.c.old +0 -73

76 lines not on this page · raw message

fs/ext2/ialloc.c renamed from fs/ext2/ialloc.c.old +0 -40
@@ -700,43 +700,3 @@
 	return count;
 }
 
-#ifdef CONFIG_EXT2_CHECK
-/* Called at mount-time, super-block is locked */
-void ext2_check_inodes_bitmap (struct super_block * sb)
-{
-	struct ext2_super_block * es = EXT2_SB(sb)->s_es;
-	unsigned long desc_count = 0, bitmap_count = 0;
-	struct buffer_head *bitmap_bh = NULL;
-	int i;
-
-	for (i = 0; i < EXT2_SB(sb)->s_groups_count; i++) {
-		struct ext2_group_desc *desc;
-		unsigned x;
-
-		desc = ext2_get_group_desc(sb, i, NULL);
-		if (!desc)
-			continue;
-		desc_count += le16_to_cpu(desc->bg_free_inodes_count);
-		brelse(bitmap_bh);
-		bitmap_bh = read_inode_bitmap(sb, i);
-		if (!bitmap_bh)
-			continue;
-		
-		x = ext2_count_free(bitmap_bh, EXT2_INODES_PER_GROUP(sb) / 8);
-		if (le16_to_cpu(desc->bg_free_inodes_count) != x)
-			ext2_error (sb, "ext2_check_inodes_bitmap",
-				    "Wrong free inodes count in group %d, "
-				    "stored = %d, counted = %lu", i,
-				    le16_to_cpu(desc->bg_free_inodes_count), x);
-		bitmap_count += x;
-	}
-	brelse(bitmap_bh);
-	if (percpu_counter_read(&EXT2_SB(sb)->s_freeinodes_counter) !=
-				bitmap_count)
-		ext2_error(sb, "ext2_check_inodes_bitmap",
-			    "Wrong free inodes count in super block, "
-			    "stored = %lu, counted = %lu",
-			    (unsigned long)le32_to_cpu(es->s_free_inodes_count),
-			    bitmap_count);
-}
-#endif
fs/ext2/super.c renamed from fs/ext2/super.c.old +1 -15
@@ -281,7 +281,7 @@
 enum {
 	Opt_bsd_df, Opt_minix_df, Opt_grpid, Opt_nogrpid,
 	Opt_resgid, Opt_resuid, Opt_sb, Opt_err_cont, Opt_err_panic,
-	Opt_err_ro, Opt_nouid32, Opt_check, Opt_nocheck, Opt_debug,
+	Opt_err_ro, Opt_nouid32, Opt_nocheck, Opt_debug,
 	Opt_oldalloc, Opt_orlov, Opt_nobh, Opt_user_xattr, Opt_nouser_xattr,
 	Opt_acl, Opt_noacl, Opt_xip, Opt_ignore, Opt_err, Opt_quota,
 	Opt_usrquota, Opt_grpquota
@@ -303,7 +303,6 @@
 	{Opt_nouid32, "nouid32"},
 	{Opt_nocheck, "check=none"},
 	{Opt_nocheck, "nocheck"},
-	{Opt_check, "check"},
 	{Opt_debug, "debug"},
 	{Opt_oldalloc, "oldalloc"},
 	{Opt_orlov, "orlov"},
@@ -376,13 +375,6 @@
 		case Opt_nouid32:
 			set_opt (sbi->s_mount_opt, NO_UID32);
 			break;
-		case Opt_check:
-#ifdef CONFIG_EXT2_CHECK
-			set_opt (sbi->s_mount_opt, CHECK);
-#else
-			printk("EXT2 Check option not supported\n");
-#endif
-			break;
 		case Opt_nocheck:
 			clear_opt (sbi->s_mount_opt, CHECK);
 			break;
@@ -503,12 +495,6 @@
 			EXT2_BLOCKS_PER_GROUP(sb),
 			EXT2_INODES_PER_GROUP(sb),
 			sbi->s_mount_opt);
-#ifdef CONFIG_EXT2_CHECK
-	if (test_opt (sb, CHECK)) {
-		ext2_check_blocks_bitmap (sb);
-		ext2_check_inodes_bitmap (sb);
-	}
-#endif
 	return res;
 }
 
fs/ext3/balloc.c renamed from fs/ext3/balloc.c.old +0 -73

76 lines not on this page · raw message

fs/ext3/ialloc.c renamed from fs/ext3/ialloc.c.old +0 -41

44 lines not on this page · raw message

fs/ext3/super.c renamed from fs/ext3/super.c.old +1 -16
@@ -625,7 +625,7 @@
 enum {
 	Opt_bsd_df, Opt_minix_df, Opt_grpid, Opt_nogrpid,
 	Opt_resgid, Opt_resuid, Opt_sb, Opt_err_cont, Opt_err_panic, Opt_err_ro,
-	Opt_nouid32, Opt_check, Opt_nocheck, Opt_debug, Opt_oldalloc, Opt_orlov,
+	Opt_nouid32, Opt_nocheck, Opt_debug, Opt_oldalloc, Opt_orlov,
 	Opt_user_xattr, Opt_nouser_xattr, Opt_acl, Opt_noacl,
 	Opt_reservation, Opt_noreservation, Opt_noload, Opt_nobh,
 	Opt_commit, Opt_journal_update, Opt_journal_inum,
@@ -652,7 +652,6 @@
 	{Opt_nouid32, "nouid32"},
 	{Opt_nocheck, "nocheck"},
 	{Opt_nocheck, "check=none"},
-	{Opt_check, "check"},
 	{Opt_debug, "debug"},
 	{Opt_oldalloc, "oldalloc"},
 	{Opt_orlov, "orlov"},
@@ -773,14 +772,6 @@
 		case Opt_nouid32:
 			set_opt (sbi->s_mount_opt, NO_UID32);
 			break;
-		case Opt_check:
-#ifdef CONFIG_EXT3_CHECK
-			set_opt (sbi->s_mount_opt, CHECK);
-#else
-			printk(KERN_ERR
-			       "EXT3 Check option not supported\n");
-#endif
-			break;
 		case Opt_nocheck:
 			clear_opt (sbi->s_mount_opt, CHECK);
 			break;
@@ -1115,12 +1106,6 @@
 	} else {
 		printk("internal journal\n");
 	}
-#ifdef CONFIG_EXT3_CHECK
-	if (test_opt (sb, CHECK)) {
-		ext3_check_blocks_bitmap (sb);
-		ext3_check_inodes_bitmap (sb);
-	}
-#endif
 	return res;
 }