]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bcachefs: Run BCH_RECOVERY_PASS_reconstruct_snapshots on missing subvol -> snapshot
authorKent Overstreet <kent.overstreet@linux.dev>
Sat, 26 Apr 2025 15:05:32 +0000 (11:05 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 28 Apr 2025 20:46:12 +0000 (16:46 -0400)
Fix this repair path.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/subvolume.c

index 5537283d0beaeb3f334dbb000be7dba7d9757563..d0209f7658bb8798aba32ffa8fcb844a1d19d292 100644 (file)
@@ -6,6 +6,7 @@
 #include "errcode.h"
 #include "error.h"
 #include "fs.h"
+#include "recovery_passes.h"
 #include "snapshot.h"
 #include "subvolume.h"
 
@@ -44,8 +45,8 @@ static int check_subvol(struct btree_trans *trans,
        ret = bch2_snapshot_lookup(trans, snapid, &snapshot);
 
        if (bch2_err_matches(ret, ENOENT))
-               bch_err(c, "subvolume %llu points to nonexistent snapshot %u",
-                       k.k->p.offset, snapid);
+               return bch2_run_explicit_recovery_pass(c,
+                                       BCH_RECOVERY_PASS_reconstruct_snapshots) ?: ret;
        if (ret)
                return ret;