From: Kent Overstreet Date: Tue, 7 Nov 2023 16:16:14 +0000 (-0500) Subject: bcachefs: Clear k->needs_whitout earlier in commit path X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=389c92b36e302d866c2850e70560667ac4a826c6;p=linux.git bcachefs: Clear k->needs_whitout earlier in commit path The upcoming btree write buffer rework is going to use the journal itself as the first stage of the write buffer; this is a cleanup to make sure k->needs_whiteout is initialized before keys hit the journal. Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/btree_trans_commit.c b/fs/bcachefs/btree_trans_commit.c index 3d66d9c595e26..4d0f388f2be12 100644 --- a/fs/bcachefs/btree_trans_commit.c +++ b/fs/bcachefs/btree_trans_commit.c @@ -655,6 +655,8 @@ bch2_trans_commit_write_locked(struct btree_trans *trans, unsigned flags, *stopped_at = i; return ret; } + + i->k->k.needs_whiteout = false; } if (trans->nr_wb_updates && @@ -777,8 +779,6 @@ bch2_trans_commit_write_locked(struct btree_trans *trans, unsigned flags, } trans_for_each_update(trans, i) { - i->k->k.needs_whiteout = false; - if (!i->cached) { u64 seq = trans->journal_res.seq;