Commit 097471f9 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Fix bch2_journal_flush_device_pins()

If a journal write errored, the list of devices it was written to could
be empty - we're not supposed to mark an empty replicas list.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent b58b1b88
......@@ -892,10 +892,12 @@ int bch2_journal_flush_device_pins(struct journal *j, int dev_idx)
journal_seq_pin(j, seq)->devs);
seq++;
if (replicas.e.nr_devs) {
spin_unlock(&j->lock);
ret = bch2_mark_replicas(c, &replicas.e);
spin_lock(&j->lock);
}
}
spin_unlock(&j->lock);
err:
ret = bch2_replicas_gc_end(c, ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment