diff options
Diffstat (limited to 'fs/ext4/ialloc.c')
| -rw-r--r-- | fs/ext4/ialloc.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index fa36372f3fdf..3a100e7a62a8 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
| @@ -725,6 +725,10 @@ repeat_in_this_group: | |||
| 725 | "inode=%lu", ino + 1); | 725 | "inode=%lu", ino + 1); |
| 726 | continue; | 726 | continue; |
| 727 | } | 727 | } |
| 728 | BUFFER_TRACE(inode_bitmap_bh, "get_write_access"); | ||
| 729 | err = ext4_journal_get_write_access(handle, inode_bitmap_bh); | ||
| 730 | if (err) | ||
| 731 | goto fail; | ||
| 728 | ext4_lock_group(sb, group); | 732 | ext4_lock_group(sb, group); |
| 729 | ret2 = ext4_test_and_set_bit(ino, inode_bitmap_bh->b_data); | 733 | ret2 = ext4_test_and_set_bit(ino, inode_bitmap_bh->b_data); |
| 730 | ext4_unlock_group(sb, group); | 734 | ext4_unlock_group(sb, group); |
| @@ -738,6 +742,11 @@ repeat_in_this_group: | |||
| 738 | goto out; | 742 | goto out; |
| 739 | 743 | ||
| 740 | got: | 744 | got: |
| 745 | BUFFER_TRACE(inode_bitmap_bh, "call ext4_handle_dirty_metadata"); | ||
| 746 | err = ext4_handle_dirty_metadata(handle, NULL, inode_bitmap_bh); | ||
| 747 | if (err) | ||
| 748 | goto fail; | ||
| 749 | |||
| 741 | /* We may have to initialize the block bitmap if it isn't already */ | 750 | /* We may have to initialize the block bitmap if it isn't already */ |
| 742 | if (ext4_has_group_desc_csum(sb) && | 751 | if (ext4_has_group_desc_csum(sb) && |
| 743 | gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) { | 752 | gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) { |
| @@ -762,9 +771,7 @@ got: | |||
| 762 | ext4_free_group_clusters_set(sb, gdp, | 771 | ext4_free_group_clusters_set(sb, gdp, |
| 763 | ext4_free_clusters_after_init(sb, group, gdp)); | 772 | ext4_free_clusters_after_init(sb, group, gdp)); |
| 764 | ext4_block_bitmap_csum_set(sb, group, gdp, | 773 | ext4_block_bitmap_csum_set(sb, group, gdp, |
| 765 | block_bitmap_bh, | 774 | block_bitmap_bh); |
| 766 | EXT4_BLOCKS_PER_GROUP(sb) / | ||
| 767 | 8); | ||
| 768 | ext4_group_desc_csum_set(sb, group, gdp); | 775 | ext4_group_desc_csum_set(sb, group, gdp); |
| 769 | } | 776 | } |
| 770 | ext4_unlock_group(sb, group); | 777 | ext4_unlock_group(sb, group); |
| @@ -773,11 +780,6 @@ got: | |||
| 773 | goto fail; | 780 | goto fail; |
| 774 | } | 781 | } |
| 775 | 782 | ||
| 776 | BUFFER_TRACE(inode_bitmap_bh, "get_write_access"); | ||
| 777 | err = ext4_journal_get_write_access(handle, inode_bitmap_bh); | ||
| 778 | if (err) | ||
| 779 | goto fail; | ||
| 780 | |||
| 781 | BUFFER_TRACE(group_desc_bh, "get_write_access"); | 783 | BUFFER_TRACE(group_desc_bh, "get_write_access"); |
| 782 | err = ext4_journal_get_write_access(handle, group_desc_bh); | 784 | err = ext4_journal_get_write_access(handle, group_desc_bh); |
| 783 | if (err) | 785 | if (err) |
| @@ -825,11 +827,6 @@ got: | |||
| 825 | } | 827 | } |
| 826 | ext4_unlock_group(sb, group); | 828 | ext4_unlock_group(sb, group); |
| 827 | 829 | ||
| 828 | BUFFER_TRACE(inode_bitmap_bh, "call ext4_handle_dirty_metadata"); | ||
| 829 | err = ext4_handle_dirty_metadata(handle, NULL, inode_bitmap_bh); | ||
| 830 | if (err) | ||
| 831 | goto fail; | ||
| 832 | |||
| 833 | BUFFER_TRACE(group_desc_bh, "call ext4_handle_dirty_metadata"); | 830 | BUFFER_TRACE(group_desc_bh, "call ext4_handle_dirty_metadata"); |
| 834 | err = ext4_handle_dirty_metadata(handle, NULL, group_desc_bh); | 831 | err = ext4_handle_dirty_metadata(handle, NULL, group_desc_bh); |
| 835 | if (err) | 832 | if (err) |
