From d602657cd185784bf4b227ecd1a88ed90735eae5 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Thu, 22 Sep 2022 21:27:42 -0400 Subject: bcachefs: Fix error handling in bch2_btree_update_start() We were checking for -EAGAIN, but we're not returned that when we didn't pass a closure to wait with - oops. Signed-off-by: Kent Overstreet --- fs/bcachefs/btree_update_interior.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/bcachefs/btree_update_interior.c b/fs/bcachefs/btree_update_interior.c index 7028597358d5..0d87b1c88ed4 100644 --- a/fs/bcachefs/btree_update_interior.c +++ b/fs/bcachefs/btree_update_interior.c @@ -1110,8 +1110,8 @@ bch2_btree_update_start(struct btree_trans *trans, struct btree_path *path, goto err; ret = bch2_btree_reserve_get(trans, as, nr_nodes, flags, NULL); - if (ret == -EAGAIN || - ret == -ENOMEM) { + if (bch2_err_matches(ret, ENOSPC) || + bch2_err_matches(ret, ENOMEM)) { struct closure cl; closure_init_stack(&cl); -- cgit v1.2.3