summaryrefslogtreecommitdiff
path: root/fs/bcachefs/btree_update_leaf.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-06-02 00:15:07 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:05 -0400
commitbc3f8b25f3a4403d6e8c9067e6f0fc9cf23be6fe (patch)
tree8313d35a9d67c0dc23763c9844ba2fba4a0403a5 /fs/bcachefs/btree_update_leaf.c
parent01254036a326e0663eaeabb2eb3359c04caed2a0 (diff)
downloadlwn-bc3f8b25f3a4403d6e8c9067e6f0fc9cf23be6fe.tar.gz
lwn-bc3f8b25f3a4403d6e8c9067e6f0fc9cf23be6fe.zip
bcachefs: Check for errors from bch2_trans_update()
Upcoming refactoring is going to change bch2_trans_update() to start returning transaction restarts. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/btree_update_leaf.c')
-rw-r--r--fs/bcachefs/btree_update_leaf.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/bcachefs/btree_update_leaf.c b/fs/bcachefs/btree_update_leaf.c
index 3c4bf13d4ef9..839262c9501a 100644
--- a/fs/bcachefs/btree_update_leaf.c
+++ b/fs/bcachefs/btree_update_leaf.c
@@ -1198,9 +1198,9 @@ int bch2_btree_delete_at(struct btree_trans *trans,
bkey_init(&k.k);
k.k.p = iter->pos;
- bch2_trans_update(trans, iter, &k, 0);
- return bch2_trans_commit(trans, NULL, NULL,
- BTREE_INSERT_NOFAIL|flags);
+ return bch2_trans_update(trans, iter, &k, 0) ?:
+ bch2_trans_commit(trans, NULL, NULL,
+ BTREE_INSERT_NOFAIL|flags);
}
int bch2_btree_delete_range_trans(struct btree_trans *trans, enum btree_id id,
@@ -1251,8 +1251,8 @@ retry:
break;
}
- bch2_trans_update(trans, iter, &delete, 0);
- ret = bch2_trans_commit(trans, NULL, journal_seq,
+ ret = bch2_trans_update(trans, iter, &delete, 0) ?:
+ bch2_trans_commit(trans, NULL, journal_seq,
BTREE_INSERT_NOFAIL);
if (ret)
break;