summaryrefslogtreecommitdiff
path: root/fs/bcachefs/recovery.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-04-16 16:54:11 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:54 -0400
commit41e3778636cab27ef43e6e1b1cf3d8c2952cc77a (patch)
tree2cec4b3a5d702e3da4b8dc4c4d523a1cb90784ab /fs/bcachefs/recovery.c
parent98f2197de49b8eb038909e709c79c13178022dda (diff)
downloadlwn-41e3778636cab27ef43e6e1b1cf3d8c2952cc77a.tar.gz
lwn-41e3778636cab27ef43e6e1b1cf3d8c2952cc77a.zip
bcachefs: Bring back metadata only gc
This is useful for the filesystem dump debugging tool - when we're hitting bugs we want to skip as much of the recovery process as possible, and the dump tool only needs to know where metadata lives. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/recovery.c')
-rw-r--r--fs/bcachefs/recovery.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index c42919277c72..740fdeafe1a2 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -1117,9 +1117,11 @@ use_clean:
!(c->sb.compat & (1ULL << BCH_COMPAT_alloc_info)) ||
!(c->sb.compat & (1ULL << BCH_COMPAT_alloc_metadata)) ||
test_bit(BCH_FS_REBUILD_REPLICAS, &c->flags)) {
+ bool metadata_only = c->opts.norecovery;
+
bch_info(c, "starting mark and sweep");
err = "error in mark and sweep";
- ret = bch2_gc(c, true);
+ ret = bch2_gc(c, true, metadata_only);
if (ret)
goto err;
bch_verbose(c, "mark and sweep done");