bcachefs: journal_seq_blacklist_add() now handles entries being added out of order
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 7 Mar 2024 17:30:49 +0000 (12:30 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 10 Mar 2024 19:09:59 +0000 (15:09 -0400)
commit6fa30fe7f79592ae2ba6e44fa1e7589942c58abe
tree664d3e5e6c941fb40e81146300a7b0f7d6a5b4f1
parentf8cdf65b51f036d77edece8a175447dd41be63ca
bcachefs: journal_seq_blacklist_add() now handles entries being added out of order

bch2_journal_seq_blacklist_add() was bugged when the new entry
overlapped with multiple existing entries, and it also assumed new
entries are being added in increasing order.

This is true on any sane filesystem, but when trying to recover from
very badly mangled filesystems we might end up with the journal sequence
number rewinding vs. what the blacklist list knows about - easiest to
just handle that here.

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