diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-03-21 19:12:52 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:18 -0400 |
commit | 8b2b9d11b9d0aea6401546780e84adcf51e27ba4 (patch) | |
tree | 75da447f5a6cb03f958d5e0f91d2c3e00755e62a /fs/bcachefs/btree_gc.c | |
parent | 6122ab639c8e3d6afe9a3c8e3e49173cd2a064a3 (diff) | |
download | linux-stable-8b2b9d11b9d0aea6401546780e84adcf51e27ba4.tar.gz linux-stable-8b2b9d11b9d0aea6401546780e84adcf51e27ba4.tar.bz2 linux-stable-8b2b9d11b9d0aea6401546780e84adcf51e27ba4.zip |
bcachefs: Fix error handling in gc
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_gc.c')
-rw-r--r-- | fs/bcachefs/btree_gc.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/bcachefs/btree_gc.c b/fs/bcachefs/btree_gc.c index 0069d6cb6e5d..302793d84b92 100644 --- a/fs/bcachefs/btree_gc.c +++ b/fs/bcachefs/btree_gc.c @@ -261,15 +261,14 @@ static int bch2_gc_btree(struct bch_fs *c, enum btree_id btree_id, return ret; mutex_lock(&c->btree_root_lock); - b = c->btree_roots[btree_id].b; if (!btree_node_fake(b)) - bch2_gc_mark_key(c, bkey_i_to_s_c(&b->key), - &max_stale, initial); + ret = bch2_gc_mark_key(c, bkey_i_to_s_c(&b->key), + &max_stale, initial); gc_pos_set(c, gc_pos_btree_root(b->btree_id)); - mutex_unlock(&c->btree_root_lock); - return 0; + + return ret; } static inline int btree_id_gc_phase_cmp(enum btree_id l, enum btree_id r) |