diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-06-02 00:15:07 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:05 -0400 |
commit | bc3f8b25f3a4403d6e8c9067e6f0fc9cf23be6fe (patch) | |
tree | 8313d35a9d67c0dc23763c9844ba2fba4a0403a5 /fs/bcachefs/alloc_background.c | |
parent | 01254036a326e0663eaeabb2eb3359c04caed2a0 (diff) | |
download | linux-bc3f8b25f3a4403d6e8c9067e6f0fc9cf23be6fe.tar.gz linux-bc3f8b25f3a4403d6e8c9067e6f0fc9cf23be6fe.tar.bz2 linux-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/alloc_background.c')
-rw-r--r-- | fs/bcachefs/alloc_background.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c index b6bfba7aea0a..15f9adf0876a 100644 --- a/fs/bcachefs/alloc_background.c +++ b/fs/bcachefs/alloc_background.c @@ -340,9 +340,9 @@ retry: return 0; bch2_alloc_pack(c, &a, new_u); - bch2_trans_update(trans, iter, &a.k, - BTREE_TRIGGER_NORUN); - ret = bch2_trans_commit(trans, NULL, NULL, + ret = bch2_trans_update(trans, iter, &a.k, + BTREE_TRIGGER_NORUN) ?: + bch2_trans_commit(trans, NULL, NULL, BTREE_INSERT_NOFAIL|flags); err: if (ret == -EINTR) @@ -726,7 +726,8 @@ static int bucket_invalidate_btree(struct btree_trans *trans, u.write_time = atomic64_read(&c->io_clock[WRITE].now); bch2_alloc_pack(c, a, u); - bch2_trans_update(trans, iter, &a->k, BTREE_TRIGGER_BUCKET_INVALIDATE); + ret = bch2_trans_update(trans, iter, &a->k, + BTREE_TRIGGER_BUCKET_INVALIDATE); err: bch2_trans_iter_put(trans, iter); return ret; |