]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/bcachefs.h
Update bcachefs sources to 4b5917839c bcachefs: Fix a null ptr deref in check_xattr()
[bcachefs-tools-debian] / libbcachefs / bcachefs.h
index 901b681332ecafe3d1f70e0db85450ba873bd0f9..82b0706a89365ee4ebdf2f1a77069c3cab93d2c5 100644 (file)
@@ -1185,11 +1185,14 @@ static inline bool bch2_dev_exists2(const struct bch_fs *c, unsigned dev)
 static inline int bch2_run_explicit_recovery_pass(struct bch_fs *c,
                                                  enum bch_recovery_pass pass)
 {
-       BUG_ON(c->curr_recovery_pass < pass);
-
        c->recovery_passes_explicit |= BIT_ULL(pass);
-       c->curr_recovery_pass = pass;
-       return -BCH_ERR_restart_recovery;
+
+       if (c->curr_recovery_pass >= pass) {
+               c->curr_recovery_pass = pass;
+               return -BCH_ERR_restart_recovery;
+       } else {
+               return 0;
+       }
 }
 
 #define BKEY_PADDED_ONSTACK(key, pad)                          \