diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-11-23 02:55:47 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-23 02:55:47 -0500 |
commit | ca9eed76133c00e7f4b1eeb4c1a6cb800cd2654c (patch) | |
tree | 5f011f4bd00c921e41605b1915c227aeaf411a0d /fs/ext3/super.c | |
parent | 8652cb4b0d87accbe78725fd2a13be2787059649 (diff) | |
parent | 13d428afc007fcfcd6deeb215618f54cf9c0cae6 (diff) |
Merge commit 'v2.6.28-rc6' into x86/debug
Diffstat (limited to 'fs/ext3/super.c')
-rw-r--r-- | fs/ext3/super.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 18eaa78ecb4e..f6c94f232ec1 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -281,7 +281,8 @@ void ext3_abort (struct super_block * sb, const char * function, | |||
281 | EXT3_SB(sb)->s_mount_state |= EXT3_ERROR_FS; | 281 | EXT3_SB(sb)->s_mount_state |= EXT3_ERROR_FS; |
282 | sb->s_flags |= MS_RDONLY; | 282 | sb->s_flags |= MS_RDONLY; |
283 | EXT3_SB(sb)->s_mount_opt |= EXT3_MOUNT_ABORT; | 283 | EXT3_SB(sb)->s_mount_opt |= EXT3_MOUNT_ABORT; |
284 | journal_abort(EXT3_SB(sb)->s_journal, -EIO); | 284 | if (EXT3_SB(sb)->s_journal) |
285 | journal_abort(EXT3_SB(sb)->s_journal, -EIO); | ||
285 | } | 286 | } |
286 | 287 | ||
287 | void ext3_warning (struct super_block * sb, const char * function, | 288 | void ext3_warning (struct super_block * sb, const char * function, |
@@ -390,11 +391,14 @@ static void ext3_put_super (struct super_block * sb) | |||
390 | { | 391 | { |
391 | struct ext3_sb_info *sbi = EXT3_SB(sb); | 392 | struct ext3_sb_info *sbi = EXT3_SB(sb); |
392 | struct ext3_super_block *es = sbi->s_es; | 393 | struct ext3_super_block *es = sbi->s_es; |
393 | int i; | 394 | int i, err; |
394 | 395 | ||
395 | ext3_xattr_put_super(sb); | 396 | ext3_xattr_put_super(sb); |
396 | if (journal_destroy(sbi->s_journal) < 0) | 397 | err = journal_destroy(sbi->s_journal); |
398 | sbi->s_journal = NULL; | ||
399 | if (err < 0) | ||
397 | ext3_abort(sb, __func__, "Couldn't clean up the journal"); | 400 | ext3_abort(sb, __func__, "Couldn't clean up the journal"); |
401 | |||
398 | if (!(sb->s_flags & MS_RDONLY)) { | 402 | if (!(sb->s_flags & MS_RDONLY)) { |
399 | EXT3_CLEAR_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER); | 403 | EXT3_CLEAR_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER); |
400 | es->s_state = cpu_to_le16(sbi->s_mount_state); | 404 | es->s_state = cpu_to_le16(sbi->s_mount_state); |
@@ -2371,12 +2375,9 @@ int ext3_force_commit(struct super_block *sb) | |||
2371 | /* | 2375 | /* |
2372 | * Ext3 always journals updates to the superblock itself, so we don't | 2376 | * Ext3 always journals updates to the superblock itself, so we don't |
2373 | * have to propagate any other updates to the superblock on disk at this | 2377 | * have to propagate any other updates to the superblock on disk at this |
2374 | * point. Just start an async writeback to get the buffers on their way | 2378 | * point. (We can probably nuke this function altogether, and remove |
2375 | * to the disk. | 2379 | * any mention to sb->s_dirt in all of fs/ext3; eventual cleanup...) |
2376 | * | ||
2377 | * This implicitly triggers the writebehind on sync(). | ||
2378 | */ | 2380 | */ |
2379 | |||
2380 | static void ext3_write_super (struct super_block * sb) | 2381 | static void ext3_write_super (struct super_block * sb) |
2381 | { | 2382 | { |
2382 | if (mutex_trylock(&sb->s_lock) != 0) | 2383 | if (mutex_trylock(&sb->s_lock) != 0) |
@@ -2386,13 +2387,12 @@ static void ext3_write_super (struct super_block * sb) | |||
2386 | 2387 | ||
2387 | static int ext3_sync_fs(struct super_block *sb, int wait) | 2388 | static int ext3_sync_fs(struct super_block *sb, int wait) |
2388 | { | 2389 | { |
2389 | tid_t target; | ||
2390 | |||
2391 | sb->s_dirt = 0; | 2390 | sb->s_dirt = 0; |
2392 | if (journal_start_commit(EXT3_SB(sb)->s_journal, &target)) { | 2391 | if (wait) |
2393 | if (wait) | 2392 | ext3_force_commit(sb); |
2394 | log_wait_commit(EXT3_SB(sb)->s_journal, target); | 2393 | else |
2395 | } | 2394 | journal_start_commit(EXT3_SB(sb)->s_journal, NULL); |
2395 | |||
2396 | return 0; | 2396 | return 0; |
2397 | } | 2397 | } |
2398 | 2398 | ||