diff --git a/fs/bcachefs/btree_node_scan.c b/fs/bcachefs/btree_node_scan.c index b28c649c6838..aa0f84d35895 100644 --- a/fs/bcachefs/btree_node_scan.c +++ b/fs/bcachefs/btree_node_scan.c @@ -280,12 +280,15 @@ static int read_btree_nodes(struct find_btree_nodes *f) percpu_ref_put(&ca->io_ref); closure_put(&cl); f->ret = ret; - bch_err(c, "error starting kthread: %i", ret); + bch_err(c, "error starting kthread: %i %d", ret, PTR_ERR(t)); break; } } err: closure_sync(&cl); + if (IS_ERR(t)) + return PTR_ERR(t); + return f->ret ?: ret; }