mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-20 05:16:14 -05:00
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: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
@@ -892,9 +892,11 @@ int bch2_journal_flush_device_pins(struct journal *j, int dev_idx)
|
||||
journal_seq_pin(j, seq)->devs);
|
||||
seq++;
|
||||
|
||||
spin_unlock(&j->lock);
|
||||
ret = bch2_mark_replicas(c, &replicas.e);
|
||||
spin_lock(&j->lock);
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user