diff options
author | Eric Sandeen <sandeen@redhat.com> | 2009-02-26 00:57:35 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-02-26 00:57:35 -0500 |
commit | 8f64b32eb73fbfe9f38c4123121b63ee409278a7 (patch) | |
tree | 1c856ed32d7a282dbde0cea2e8839e2c2de51ba9 | |
parent | d8ae4601a4b7ea1fa17fa395c3468c0e144d1275 (diff) |
ext4: don't call jbd2_journal_force_commit_nested without journal
Running without a journal, I oopsed when I ran out of space,
because we called jbd2_journal_force_commit_nested() from
ext4_should_retry_alloc() without a journal.
This should take care of it, I think.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r-- | fs/ext4/balloc.c | 4 | ||||
-rw-r--r-- | fs/ext4/inode.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 9a50b8052dcf..de9459b4cb94 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c | |||
@@ -609,7 +609,9 @@ int ext4_claim_free_blocks(struct ext4_sb_info *sbi, | |||
609 | */ | 609 | */ |
610 | int ext4_should_retry_alloc(struct super_block *sb, int *retries) | 610 | int ext4_should_retry_alloc(struct super_block *sb, int *retries) |
611 | { | 611 | { |
612 | if (!ext4_has_free_blocks(EXT4_SB(sb), 1) || (*retries)++ > 3) | 612 | if (!ext4_has_free_blocks(EXT4_SB(sb), 1) || |
613 | (*retries)++ > 3 || | ||
614 | !EXT4_SB(sb)->s_journal) | ||
613 | return 0; | 615 | return 0; |
614 | 616 | ||
615 | jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id); | 617 | jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id); |
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 51cdd13e1c31..c7fed5b18745 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -2544,7 +2544,7 @@ retry: | |||
2544 | 2544 | ||
2545 | ext4_journal_stop(handle); | 2545 | ext4_journal_stop(handle); |
2546 | 2546 | ||
2547 | if (mpd.retval == -ENOSPC) { | 2547 | if ((mpd.retval == -ENOSPC) && sbi->s_journal) { |
2548 | /* commit the transaction which would | 2548 | /* commit the transaction which would |
2549 | * free blocks released in the transaction | 2549 | * free blocks released in the transaction |
2550 | * and try again | 2550 | * and try again |