summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hill <daniel@gluo.nz>2022-02-23 01:25:03 +1300
committerKent Overstreet <kent.overstreet@gmail.com>2022-04-02 16:02:54 -0400
commit8281aed5ec5beb9eca095d839fb49c8f72d9499d (patch)
tree7471e94192bf82bea154eb9d970be9cbf62ce212
parenta91fddbd7e0caeab4f30c841435d1b8f2ca4a5f3 (diff)
bcachefs: Fix LRU repair code
Don't run triggers when repairing incorrect/missing lru entries Triggers create a conflicting call to lru_change() with the incorrect lru ptr, lru_change attempts to delete this incorrect lru entry, and fails because the back ptr doesn't match the original bucket causing fsck to error. Signed-off-by: Daniel Hill <daniel@gluo.nz>
-rw-r--r--fs/bcachefs/alloc_background.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c
index b344705572cc..da7c665773d2 100644
--- a/fs/bcachefs/alloc_background.c
+++ b/fs/bcachefs/alloc_background.c
@@ -646,7 +646,7 @@ static int bch2_check_alloc_key(struct btree_trans *trans,
ret = bch2_lru_change(trans, a.dev, a.bucket,
0, &a.read_time) ?:
(a.read_time != read_time
- ? bch2_alloc_write(trans, alloc_iter, &a, 0)
+ ? bch2_alloc_write(trans, alloc_iter, &a, BTREE_TRIGGER_NORUN)
: 0) ?:
bch2_trans_commit(trans, NULL, NULL, 0);
if (ret)