From: Stephen Tweedie s_debts is currently not used by ext3 (it is created, destroyed and checked but never set). Remove it for now. Resurrecting this will require adding it back in changed form. In existing form it's already unsafe wrt. byte-tearing as it performs unlocked byte increment/decrement on words which may be being accessed simultaneously on other CPUs. It is also the only in-memory dynamic table which needs to be extended by online-resize, so locking it will require care. Signed-off-by: Stephen Tweedie Signed-off-by: Andrew Morton --- 25-akpm/fs/ext3/ialloc.c | 2 -- 25-akpm/fs/ext3/super.c | 9 --------- 25-akpm/include/linux/ext3_fs_sb.h | 1 - 3 files changed, 12 deletions(-) diff -puN fs/ext3/ialloc.c~ext3-online-resize-remove-s_debts fs/ext3/ialloc.c --- 25/fs/ext3/ialloc.c~ext3-online-resize-remove-s_debts Thu Sep 30 17:33:37 2004 +++ 25-akpm/fs/ext3/ialloc.c Thu Sep 30 17:33:37 2004 @@ -320,8 +320,6 @@ static int find_group_orlov(struct super desc = ext3_get_group_desc (sb, group, &bh); if (!desc || !desc->bg_free_inodes_count) continue; - if (sbi->s_debts[group] >= max_debt) - continue; if (le16_to_cpu(desc->bg_used_dirs_count) >= max_dirs) continue; if (le16_to_cpu(desc->bg_free_inodes_count) < min_inodes) diff -puN fs/ext3/super.c~ext3-online-resize-remove-s_debts fs/ext3/super.c --- 25/fs/ext3/super.c~ext3-online-resize-remove-s_debts Thu Sep 30 17:33:37 2004 +++ 25-akpm/fs/ext3/super.c Thu Sep 30 17:33:37 2004 @@ -400,7 +400,6 @@ void ext3_put_super (struct super_block for (i = 0; i < sbi->s_gdb_count; i++) brelse(sbi->s_group_desc[i]); kfree(sbi->s_group_desc); - kfree(sbi->s_debts); brelse(sbi->s_sbh); #ifdef CONFIG_QUOTA for (i = 0; i < MAXQUOTAS; i++) { @@ -1458,13 +1457,6 @@ static int ext3_fill_super (struct super printk (KERN_ERR "EXT3-fs: not enough memory\n"); goto failed_mount; } - sbi->s_debts = kmalloc(sbi->s_groups_count * sizeof(u8), - GFP_KERNEL); - if (!sbi->s_debts) { - printk("EXT3-fs: not enough memory to allocate s_bgi\n"); - goto failed_mount2; - } - memset(sbi->s_debts, 0, sbi->s_groups_count * sizeof(u8)); percpu_counter_init(&sbi->s_freeblocks_counter); percpu_counter_init(&sbi->s_freeinodes_counter); @@ -1614,7 +1606,6 @@ static int ext3_fill_super (struct super failed_mount3: journal_destroy(sbi->s_journal); failed_mount2: - kfree(sbi->s_debts); for (i = 0; i < db_count; i++) brelse(sbi->s_group_desc[i]); kfree(sbi->s_group_desc); diff -puN include/linux/ext3_fs_sb.h~ext3-online-resize-remove-s_debts include/linux/ext3_fs_sb.h --- 25/include/linux/ext3_fs_sb.h~ext3-online-resize-remove-s_debts Thu Sep 30 17:33:37 2004 +++ 25-akpm/include/linux/ext3_fs_sb.h Thu Sep 30 17:33:37 2004 @@ -54,7 +54,6 @@ struct ext3_sb_info { u32 s_next_generation; u32 s_hash_seed[4]; int s_def_hash_version; - u8 *s_debts; struct percpu_counter s_freeblocks_counter; struct percpu_counter s_freeinodes_counter; struct percpu_counter s_dirs_counter; _