summaryrefslogtreecommitdiff
path: root/fs/bcachefs/fs-io.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-08-16 09:58:07 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:25 -0400
commit3c7f3b7aeb73f2155aec9d00567b70ef55ede465 (patch)
treeb15d0dd40a4213018b9d6c3f9c4fb38fd5f5ff97 /fs/bcachefs/fs-io.c
parent63069bb6bf03ac7a55c53886a1380899df3a176d (diff)
downloadlwn-3c7f3b7aeb73f2155aec9d00567b70ef55ede465.tar.gz
lwn-3c7f3b7aeb73f2155aec9d00567b70ef55ede465.zip
bcachefs: Refactor bch2_extent_trim_atomic() for reflink
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fs-io.c')
-rw-r--r--fs/bcachefs/fs-io.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c
index 91a34ca5e4e1..ef94aecaa7cb 100644
--- a/fs/bcachefs/fs-io.c
+++ b/fs/bcachefs/fs-io.c
@@ -310,7 +310,9 @@ int bch2_extent_update(struct btree_trans *trans,
if (ret)
return ret;
- bch2_extent_trim_atomic(k, extent_iter);
+ ret = bch2_extent_trim_atomic(k, extent_iter);
+ if (ret)
+ return ret;
ret = sum_sector_overwrites(trans, extent_iter,
k, &allocating,
@@ -2634,7 +2636,9 @@ static long bch2_fcollapse(struct bch_inode_info *inode,
bch2_cut_front(src->pos, &copy.k);
copy.k.k.p.offset -= len >> 9;
- bch2_extent_trim_atomic(&copy.k, dst);
+ ret = bch2_extent_trim_atomic(&copy.k, dst);
+ if (ret)
+ goto bkey_err;
BUG_ON(bkey_cmp(dst->pos, bkey_start_pos(&copy.k.k)));