[Patch 8/10]: ext3 online resize: remove s_debts
From: Stephen Tweedie (sct_at_redhat.com)
Date: 09/30/04
- Previous message: Stephen Tweedie: "[Patch 7/10]: ext3 online resize: SMP locking for group metadata"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 30 Sep 2004 14:23:55 +0100 To: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>, Andreas Dilger <adilger@clusterfs.com>, "Theodore Ts'o" <tytso@mit.edu>, ext2-devel@lists.sourceforge.net
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 <sct@redhat.com>
--- linux-2.6.9-rc2-mm4/fs/ext3/ialloc.c.=K0007=.orig
+++ linux-2.6.9-rc2-mm4/fs/ext3/ialloc.c
@@ -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)
--- linux-2.6.9-rc2-mm4/fs/ext3/super.c.=K0007=.orig
+++ linux-2.6.9-rc2-mm4/fs/ext3/super.c
@@ -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++) {
@@ -1460,13 +1459,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);
@@ -1618,7 +1610,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);
--- linux-2.6.9-rc2-mm4/include/linux/ext3_fs_sb.h.=K0007=.orig
+++ linux-2.6.9-rc2-mm4/include/linux/ext3_fs_sb.h
@@ -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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Previous message: Stephen Tweedie: "[Patch 7/10]: ext3 online resize: SMP locking for group metadata"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: 1352 NUL bytes at the end of a page? (was Re: Assertion `s && s->tree failed: The sag
... >> elsewhere, we are writing to a tmp file, the tmp file is NOT mmapped. ...
You've described it correctly for reiserfs though, we unlock the page ... I don't see how
you can trigger this on ext3 without truncate jumping ... send the line "unsubscribe
linux-kernel" in ... (Linux-Kernel) - Re: mmap() on cdrom files fails since 2.6.9-rc2-bk2
... ext3 rw: OK ... vfat ro: FAILED ... static void test_mmap(int
fd, size_t size, int flags) ... send the line "unsubscribe linux-kernel" in ...
(Linux-Kernel) - Re: [PATCH] prelim ACPI support for aic7xxx
... But it's time to get some more eyes on it. ... The good news is it ...
> mounted read-write then you will get aborted commands, ext3 will ... send the line
"unsubscribe linux-kernel" in ... (Linux-Kernel) - Re: mode data=journal in ext3. Is it safe to use?
... > corruption. ... We are not going to use quota, we are using ext3
on a compact flash disk ... To unsubscribe from this list: send the line "unsubscribe linux-kernel"
in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/ ... (Linux-Kernel) - Re: Linux 2.4.30-rc3 md/ext3 problems
... > I suspect that change which caused the problem is a change in ext3. ...
> after it has waited on a locked buffer, and triggers a journal abort ... This should
be perfectly safe, ... send the line "unsubscribe linux-kernel" in ... (Linux-Kernel)