summaryrefslogtreecommitdiff
path: root/fs/bcachefs/migrate.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/migrate.c
parent01254036a326e0663eaeabb2eb3359c04caed2a0 (diff)
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/migrate.c')
-rw-r--r--fs/bcachefs/migrate.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/bcachefs/migrate.c b/fs/bcachefs/migrate.c
index ef69a19f494a..6ebe49ba2248 100644
--- a/fs/bcachefs/migrate.c
+++ b/fs/bcachefs/migrate.c
@@ -73,9 +73,8 @@ static int __bch2_dev_usrdata_drop(struct bch_fs *c, unsigned dev_idx, int flags
bch2_btree_iter_set_pos(iter, bkey_start_pos(&sk.k->k));
- bch2_trans_update(&trans, iter, sk.k, 0);
-
- ret = bch2_trans_commit(&trans, NULL, NULL,
+ ret = bch2_trans_update(&trans, iter, sk.k, 0) ?:
+ bch2_trans_commit(&trans, NULL, NULL,
BTREE_INSERT_NOFAIL);
/*