mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-09-07 14:19:35 +00:00
bcachefs: Add an error message for insufficient rw journal devs
This causes us to go read-only - need an error message saying why. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
ee1b8dc17a
commit
f12410bb7d
@ -205,6 +205,17 @@ void bch2_journal_space_available(struct journal *j)
|
|||||||
j->can_discard = can_discard;
|
j->can_discard = can_discard;
|
||||||
|
|
||||||
if (nr_online < metadata_replicas_required(c)) {
|
if (nr_online < metadata_replicas_required(c)) {
|
||||||
|
struct printbuf buf = PRINTBUF;
|
||||||
|
prt_printf(&buf, "insufficient writeable journal devices available: have %u, need %u\n"
|
||||||
|
"rw journal devs:", nr_online, metadata_replicas_required(c));
|
||||||
|
|
||||||
|
rcu_read_lock();
|
||||||
|
for_each_member_device_rcu(c, ca, &c->rw_devs[BCH_DATA_journal])
|
||||||
|
prt_printf(&buf, " %s", ca->name);
|
||||||
|
rcu_read_unlock();
|
||||||
|
|
||||||
|
bch_err(c, "%s", buf.buf);
|
||||||
|
printbuf_exit(&buf);
|
||||||
ret = JOURNAL_ERR_insufficient_devices;
|
ret = JOURNAL_ERR_insufficient_devices;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user