aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index a79299a89b7d..f53470112670 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -2043,12 +2043,15 @@ static noinline int add_pending_csums(struct btrfs_trans_handle *trans,
2043 struct inode *inode, struct list_head *list) 2043 struct inode *inode, struct list_head *list)
2044{ 2044{
2045 struct btrfs_ordered_sum *sum; 2045 struct btrfs_ordered_sum *sum;
2046 int ret;
2046 2047
2047 list_for_each_entry(sum, list, list) { 2048 list_for_each_entry(sum, list, list) {
2048 trans->adding_csums = true; 2049 trans->adding_csums = true;
2049 btrfs_csum_file_blocks(trans, 2050 ret = btrfs_csum_file_blocks(trans,
2050 BTRFS_I(inode)->root->fs_info->csum_root, sum); 2051 BTRFS_I(inode)->root->fs_info->csum_root, sum);
2051 trans->adding_csums = false; 2052 trans->adding_csums = false;
2053 if (ret)
2054 return ret;
2052 } 2055 }
2053 return 0; 2056 return 0;
2054} 2057}
@@ -3062,7 +3065,11 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent)
3062 goto out; 3065 goto out;
3063 } 3066 }
3064 3067
3065 add_pending_csums(trans, inode, &ordered_extent->list); 3068 ret = add_pending_csums(trans, inode, &ordered_extent->list);
3069 if (ret) {
3070 btrfs_abort_transaction(trans, ret);
3071 goto out;
3072 }
3066 3073
3067 btrfs_ordered_update_i_size(inode, 0, ordered_extent); 3074 btrfs_ordered_update_i_size(inode, 0, ordered_extent);
3068 ret = btrfs_update_inode_fallback(trans, root, inode); 3075 ret = btrfs_update_inode_fallback(trans, root, inode);