From 8281aed5ec5beb9eca095d839fb49c8f72d9499d Mon Sep 17 00:00:00 2001 From: Daniel Hill Date: Wed, 23 Feb 2022 01:25:03 +1300 Subject: 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 --- fs/bcachefs/alloc_background.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.2.3