aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2008-10-10 20:07:20 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-10-10 20:07:20 -0400
commitc2774d84fd6cab2bfa2a2fae0b1ca8d8ebde48a2 (patch)
tree1319b98e55968e3223d8f2fb6cd7807cdfd80fe1 /fs
parent688f05a01983711a4e715b1d6e15a89a89c96a66 (diff)
ext4: Do mballoc init before doing filesystem recovery
During filesystem recovery we may be doing a truncate which expects some of the mballoc data structures to be initialized. So do ext4_mb_init before recovery. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/super.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index dea8f13c2fd9..4f41107021cf 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2456,6 +2456,21 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
2456 "available.\n"); 2456 "available.\n");
2457 } 2457 }
2458 2458
2459 if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) {
2460 printk(KERN_WARNING "EXT4-fs: Ignoring delalloc option - "
2461 "requested data journaling mode\n");
2462 clear_opt(sbi->s_mount_opt, DELALLOC);
2463 } else if (test_opt(sb, DELALLOC))
2464 printk(KERN_INFO "EXT4-fs: delayed allocation enabled\n");
2465
2466 ext4_ext_init(sb);
2467 err = ext4_mb_init(sb, needs_recovery);
2468 if (err) {
2469 printk(KERN_ERR "EXT4-fs: failed to initalize mballoc (%d)\n",
2470 err);
2471 goto failed_mount4;
2472 }
2473
2459 /* 2474 /*
2460 * akpm: core read_super() calls in here with the superblock locked. 2475 * akpm: core read_super() calls in here with the superblock locked.
2461 * That deadlocks, because orphan cleanup needs to lock the superblock 2476 * That deadlocks, because orphan cleanup needs to lock the superblock
@@ -2475,21 +2490,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
2475 test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA ? "ordered": 2490 test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_ORDERED_DATA ? "ordered":
2476 "writeback"); 2491 "writeback");
2477 2492
2478 if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) {
2479 printk(KERN_WARNING "EXT4-fs: Ignoring delalloc option - "
2480 "requested data journaling mode\n");
2481 clear_opt(sbi->s_mount_opt, DELALLOC);
2482 } else if (test_opt(sb, DELALLOC))
2483 printk(KERN_INFO "EXT4-fs: delayed allocation enabled\n");
2484
2485 ext4_ext_init(sb);
2486 err = ext4_mb_init(sb, needs_recovery);
2487 if (err) {
2488 printk(KERN_ERR "EXT4-fs: failed to initalize mballoc (%d)\n",
2489 err);
2490 goto failed_mount4;
2491 }
2492
2493 lock_kernel(); 2493 lock_kernel();
2494 return 0; 2494 return 0;
2495 2495