aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/inode.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index da2680263d9f..4a238d676e5b 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1769,9 +1769,12 @@ static int btrfs_finish_ordered_io(struct inode *inode, u64 start, u64 end)
1769 add_pending_csums(trans, inode, ordered_extent->file_offset, 1769 add_pending_csums(trans, inode, ordered_extent->file_offset,
1770 &ordered_extent->list); 1770 &ordered_extent->list);
1771 1771
1772 btrfs_ordered_update_i_size(inode, 0, ordered_extent); 1772 ret = btrfs_ordered_update_i_size(inode, 0, ordered_extent);
1773 ret = btrfs_update_inode(trans, root, inode); 1773 if (!ret) {
1774 BUG_ON(ret); 1774 ret = btrfs_update_inode(trans, root, inode);
1775 BUG_ON(ret);
1776 }
1777 ret = 0;
1775out: 1778out:
1776 if (nolock) { 1779 if (nolock) {
1777 if (trans) 1780 if (trans)
@@ -5865,8 +5868,10 @@ again:
5865 } 5868 }
5866 5869
5867 add_pending_csums(trans, inode, ordered->file_offset, &ordered->list); 5870 add_pending_csums(trans, inode, ordered->file_offset, &ordered->list);
5868 btrfs_ordered_update_i_size(inode, 0, ordered); 5871 ret = btrfs_ordered_update_i_size(inode, 0, ordered);
5869 btrfs_update_inode(trans, root, inode); 5872 if (!ret)
5873 btrfs_update_inode(trans, root, inode);
5874 ret = 0;
5870out_unlock: 5875out_unlock:
5871 unlock_extent_cached(&BTRFS_I(inode)->io_tree, ordered->file_offset, 5876 unlock_extent_cached(&BTRFS_I(inode)->io_tree, ordered->file_offset,
5872 ordered->file_offset + ordered->len - 1, 5877 ordered->file_offset + ordered->len - 1,