diff options
Diffstat (limited to 'fs/ext4')
| -rw-r--r-- | fs/ext4/balloc.c | 4 | ||||
| -rw-r--r-- | fs/ext4/ialloc.c | 7 | ||||
| -rw-r--r-- | fs/ext4/inode.c | 11 | ||||
| -rw-r--r-- | fs/ext4/super.c | 1 |
4 files changed, 19 insertions, 4 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 9a50b8052dc..de9459b4cb9 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/ialloc.c b/fs/ext4/ialloc.c index 4fb86a0061d..f18a919be70 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
| @@ -715,6 +715,13 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode) | |||
| 715 | 715 | ||
| 716 | if (sbi->s_log_groups_per_flex) { | 716 | if (sbi->s_log_groups_per_flex) { |
| 717 | ret2 = find_group_flex(sb, dir, &group); | 717 | ret2 = find_group_flex(sb, dir, &group); |
| 718 | if (ret2 == -1) { | ||
| 719 | ret2 = find_group_other(sb, dir, &group); | ||
| 720 | if (ret2 == 0 && printk_ratelimit()) | ||
| 721 | printk(KERN_NOTICE "ext4: find_group_flex " | ||
| 722 | "failed, fallback succeeded dir %lu\n", | ||
| 723 | dir->i_ino); | ||
| 724 | } | ||
| 718 | goto got_group; | 725 | goto got_group; |
| 719 | } | 726 | } |
| 720 | 727 | ||
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index cbd2ca99d11..c7fed5b1874 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
| @@ -1368,6 +1368,10 @@ retry: | |||
| 1368 | goto out; | 1368 | goto out; |
| 1369 | } | 1369 | } |
| 1370 | 1370 | ||
| 1371 | /* We cannot recurse into the filesystem as the transaction is already | ||
| 1372 | * started */ | ||
| 1373 | flags |= AOP_FLAG_NOFS; | ||
| 1374 | |||
| 1371 | page = grab_cache_page_write_begin(mapping, index, flags); | 1375 | page = grab_cache_page_write_begin(mapping, index, flags); |
| 1372 | if (!page) { | 1376 | if (!page) { |
| 1373 | ext4_journal_stop(handle); | 1377 | ext4_journal_stop(handle); |
| @@ -1377,7 +1381,7 @@ retry: | |||
| 1377 | *pagep = page; | 1381 | *pagep = page; |
| 1378 | 1382 | ||
| 1379 | ret = block_write_begin(file, mapping, pos, len, flags, pagep, fsdata, | 1383 | ret = block_write_begin(file, mapping, pos, len, flags, pagep, fsdata, |
| 1380 | ext4_get_block); | 1384 | ext4_get_block); |
| 1381 | 1385 | ||
| 1382 | if (!ret && ext4_should_journal_data(inode)) { | 1386 | if (!ret && ext4_should_journal_data(inode)) { |
| 1383 | ret = walk_page_buffers(handle, page_buffers(page), | 1387 | ret = walk_page_buffers(handle, page_buffers(page), |
| @@ -2540,7 +2544,7 @@ retry: | |||
| 2540 | 2544 | ||
| 2541 | ext4_journal_stop(handle); | 2545 | ext4_journal_stop(handle); |
| 2542 | 2546 | ||
| 2543 | if (mpd.retval == -ENOSPC) { | 2547 | if ((mpd.retval == -ENOSPC) && sbi->s_journal) { |
| 2544 | /* commit the transaction which would | 2548 | /* commit the transaction which would |
| 2545 | * free blocks released in the transaction | 2549 | * free blocks released in the transaction |
| 2546 | * and try again | 2550 | * and try again |
| @@ -2667,6 +2671,9 @@ retry: | |||
| 2667 | ret = PTR_ERR(handle); | 2671 | ret = PTR_ERR(handle); |
| 2668 | goto out; | 2672 | goto out; |
| 2669 | } | 2673 | } |
| 2674 | /* We cannot recurse into the filesystem as the transaction is already | ||
| 2675 | * started */ | ||
| 2676 | flags |= AOP_FLAG_NOFS; | ||
| 2670 | 2677 | ||
| 2671 | page = grab_cache_page_write_begin(mapping, index, flags); | 2678 | page = grab_cache_page_write_begin(mapping, index, flags); |
| 2672 | if (!page) { | 2679 | if (!page) { |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index a5732c58f67..39d1993cfa1 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
| @@ -3091,7 +3091,6 @@ static int ext4_freeze(struct super_block *sb) | |||
| 3091 | 3091 | ||
| 3092 | /* Journal blocked and flushed, clear needs_recovery flag. */ | 3092 | /* Journal blocked and flushed, clear needs_recovery flag. */ |
| 3093 | EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER); | 3093 | EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER); |
| 3094 | ext4_commit_super(sb, EXT4_SB(sb)->s_es, 1); | ||
| 3095 | error = ext4_commit_super(sb, EXT4_SB(sb)->s_es, 1); | 3094 | error = ext4_commit_super(sb, EXT4_SB(sb)->s_es, 1); |
| 3096 | if (error) | 3095 | if (error) |
| 3097 | goto out; | 3096 | goto out; |
