diff options
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 4356ef6d728e..b54b261ded36 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -391,7 +391,7 @@ void ext4_da_update_reserve_space(struct inode *inode, | |||
391 | * inode's preallocations. | 391 | * inode's preallocations. |
392 | */ | 392 | */ |
393 | if ((ei->i_reserved_data_blocks == 0) && | 393 | if ((ei->i_reserved_data_blocks == 0) && |
394 | (atomic_read(&inode->i_writecount) == 0)) | 394 | !inode_is_open_for_write(inode)) |
395 | ext4_discard_preallocations(inode); | 395 | ext4_discard_preallocations(inode); |
396 | } | 396 | } |
397 | 397 | ||
@@ -678,8 +678,6 @@ found: | |||
678 | if (flags & EXT4_GET_BLOCKS_ZERO && | 678 | if (flags & EXT4_GET_BLOCKS_ZERO && |
679 | map->m_flags & EXT4_MAP_MAPPED && | 679 | map->m_flags & EXT4_MAP_MAPPED && |
680 | map->m_flags & EXT4_MAP_NEW) { | 680 | map->m_flags & EXT4_MAP_NEW) { |
681 | clean_bdev_aliases(inode->i_sb->s_bdev, map->m_pblk, | ||
682 | map->m_len); | ||
683 | ret = ext4_issue_zeroout(inode, map->m_lblk, | 681 | ret = ext4_issue_zeroout(inode, map->m_lblk, |
684 | map->m_pblk, map->m_len); | 682 | map->m_pblk, map->m_len); |
685 | if (ret) { | 683 | if (ret) { |
@@ -1194,7 +1192,6 @@ static int ext4_block_write_begin(struct page *page, loff_t pos, unsigned len, | |||
1194 | if (err) | 1192 | if (err) |
1195 | break; | 1193 | break; |
1196 | if (buffer_new(bh)) { | 1194 | if (buffer_new(bh)) { |
1197 | clean_bdev_bh_alias(bh); | ||
1198 | if (PageUptodate(page)) { | 1195 | if (PageUptodate(page)) { |
1199 | clear_buffer_new(bh); | 1196 | clear_buffer_new(bh); |
1200 | set_buffer_uptodate(bh); | 1197 | set_buffer_uptodate(bh); |
@@ -2489,10 +2486,6 @@ static int mpage_map_one_extent(handle_t *handle, struct mpage_da_data *mpd) | |||
2489 | } | 2486 | } |
2490 | 2487 | ||
2491 | BUG_ON(map->m_len == 0); | 2488 | BUG_ON(map->m_len == 0); |
2492 | if (map->m_flags & EXT4_MAP_NEW) { | ||
2493 | clean_bdev_aliases(inode->i_sb->s_bdev, map->m_pblk, | ||
2494 | map->m_len); | ||
2495 | } | ||
2496 | return 0; | 2489 | return 0; |
2497 | } | 2490 | } |
2498 | 2491 | ||
@@ -2835,12 +2828,12 @@ retry: | |||
2835 | goto unplug; | 2828 | goto unplug; |
2836 | } | 2829 | } |
2837 | ret = mpage_prepare_extent_to_map(&mpd); | 2830 | ret = mpage_prepare_extent_to_map(&mpd); |
2831 | /* Unlock pages we didn't use */ | ||
2832 | mpage_release_unused_pages(&mpd, false); | ||
2838 | /* Submit prepared bio */ | 2833 | /* Submit prepared bio */ |
2839 | ext4_io_submit(&mpd.io_submit); | 2834 | ext4_io_submit(&mpd.io_submit); |
2840 | ext4_put_io_end_defer(mpd.io_submit.io_end); | 2835 | ext4_put_io_end_defer(mpd.io_submit.io_end); |
2841 | mpd.io_submit.io_end = NULL; | 2836 | mpd.io_submit.io_end = NULL; |
2842 | /* Unlock pages we didn't use */ | ||
2843 | mpage_release_unused_pages(&mpd, false); | ||
2844 | if (ret < 0) | 2837 | if (ret < 0) |
2845 | goto unplug; | 2838 | goto unplug; |
2846 | 2839 | ||
@@ -2908,10 +2901,11 @@ retry: | |||
2908 | handle = NULL; | 2901 | handle = NULL; |
2909 | mpd.do_map = 0; | 2902 | mpd.do_map = 0; |
2910 | } | 2903 | } |
2911 | /* Submit prepared bio */ | ||
2912 | ext4_io_submit(&mpd.io_submit); | ||
2913 | /* Unlock pages we didn't use */ | 2904 | /* Unlock pages we didn't use */ |
2914 | mpage_release_unused_pages(&mpd, give_up_on_write); | 2905 | mpage_release_unused_pages(&mpd, give_up_on_write); |
2906 | /* Submit prepared bio */ | ||
2907 | ext4_io_submit(&mpd.io_submit); | ||
2908 | |||
2915 | /* | 2909 | /* |
2916 | * Drop our io_end reference we got from init. We have | 2910 | * Drop our io_end reference we got from init. We have |
2917 | * to be careful and use deferred io_end finishing if | 2911 | * to be careful and use deferred io_end finishing if |
@@ -5349,7 +5343,6 @@ static int ext4_do_update_inode(handle_t *handle, | |||
5349 | err = ext4_journal_get_write_access(handle, EXT4_SB(sb)->s_sbh); | 5343 | err = ext4_journal_get_write_access(handle, EXT4_SB(sb)->s_sbh); |
5350 | if (err) | 5344 | if (err) |
5351 | goto out_brelse; | 5345 | goto out_brelse; |
5352 | ext4_update_dynamic_rev(sb); | ||
5353 | ext4_set_feature_large_file(sb); | 5346 | ext4_set_feature_large_file(sb); |
5354 | ext4_handle_sync(handle); | 5347 | ext4_handle_sync(handle); |
5355 | err = ext4_handle_dirty_super(handle, sb); | 5348 | err = ext4_handle_dirty_super(handle, sb); |
@@ -6000,7 +5993,7 @@ int ext4_expand_extra_isize(struct inode *inode, | |||
6000 | 5993 | ||
6001 | ext4_write_lock_xattr(inode, &no_expand); | 5994 | ext4_write_lock_xattr(inode, &no_expand); |
6002 | 5995 | ||
6003 | BUFFER_TRACE(iloc.bh, "get_write_access"); | 5996 | BUFFER_TRACE(iloc->bh, "get_write_access"); |
6004 | error = ext4_journal_get_write_access(handle, iloc->bh); | 5997 | error = ext4_journal_get_write_access(handle, iloc->bh); |
6005 | if (error) { | 5998 | if (error) { |
6006 | brelse(iloc->bh); | 5999 | brelse(iloc->bh); |