Skip to content

Commit 7ee4be9

Browse files
author
Kent Overstreet
committed
bcachefs: fix restart handling in bch2_do_invalidates_work()
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 <[email protected]>
1 parent 028f3c1 commit 7ee4be9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fs/bcachefs/alloc_background.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2137,14 +2137,15 @@ static void bch2_do_invalidates_work(struct work_struct *work)
21372137

21382138
struct bkey_s_c k = next_lru_key(trans, &iter, ca, &wrapped);
21392139
ret = bkey_err(k);
2140-
if (bch2_err_matches(ret, BCH_ERR_transaction_restart))
2141-
continue;
21422140
if (ret)
2143-
break;
2141+
goto restart_err;
21442142
if (!k.k)
21452143
break;
21462144

21472145
ret = invalidate_one_bucket(trans, &iter, k, &nr_to_invalidate);
2146+
restart_err:
2147+
if (bch2_err_matches(ret, BCH_ERR_transaction_restart))
2148+
continue;
21482149
if (ret)
21492150
break;
21502151

0 commit comments

Comments
 (0)