bcachefs: Fix bch2_journal_flush_device_pins()

It's now legal for the pin fifo to be empty, which means this code needs
to be updated in order to not hit an assert.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
Kent Overstreet 2022-03-07 01:35:55 -05:00 committed by Kent Overstreet
parent e242b92af5
commit a2b9a5b272

View File

@ -831,10 +831,12 @@ int bch2_journal_flush_device_pins(struct journal *j, int dev_idx)
seq = 0;
spin_lock(&j->lock);
while (!ret && seq < j->pin.back) {
while (!ret) {
struct bch_replicas_padded replicas;
seq = max(seq, journal_last_seq(j));
if (seq >= j->pin.back)
break;
bch2_devlist_to_replicas(&replicas.e, BCH_DATA_journal,
journal_seq_pin(j, seq)->devs);
seq++;