bcachefs: fix restart handling in bch2_do_invalidates_work()
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 15 Oct 2024 06:13:22 +0000 (02:13 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Fri, 18 Oct 2024 04:49:47 +0000 (00:49 -0400)
this one is fairly harmless since the invalidate worker will just run
again later if it needs to, but still worth fixing

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

index 6e161f8ffe8d771b8225c14c20a90f26e06ac0a7..50f1919f4cbf670ed83a51d71bbbe721ebc2191c 100644 (file)
@@ -2137,14 +2137,15 @@ static void bch2_do_invalidates_work(struct work_struct *work)
 
                struct bkey_s_c k = next_lru_key(trans, &iter, ca, &wrapped);
                ret = bkey_err(k);
-               if (bch2_err_matches(ret, BCH_ERR_transaction_restart))
-                       continue;
                if (ret)
-                       break;
+                       goto restart_err;
                if (!k.k)
                        break;
 
                ret = invalidate_one_bucket(trans, &iter, k, &nr_to_invalidate);
+restart_err:
+               if (bch2_err_matches(ret, BCH_ERR_transaction_restart))
+                       continue;
                if (ret)
                        break;