Skip to content

Commit f12410b

Browse files
author
Kent Overstreet
committed
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 <[email protected]>
1 parent ee1b8dc commit f12410b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

fs/bcachefs/journal_reclaim.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,17 @@ void bch2_journal_space_available(struct journal *j)
205205
j->can_discard = can_discard;
206206

207207
if (nr_online < metadata_replicas_required(c)) {
208+
struct printbuf buf = PRINTBUF;
209+
prt_printf(&buf, "insufficient writeable journal devices available: have %u, need %u\n"
210+
"rw journal devs:", nr_online, metadata_replicas_required(c));
211+
212+
rcu_read_lock();
213+
for_each_member_device_rcu(c, ca, &c->rw_devs[BCH_DATA_journal])
214+
prt_printf(&buf, " %s", ca->name);
215+
rcu_read_unlock();
216+
217+
bch_err(c, "%s", buf.buf);
218+
printbuf_exit(&buf);
208219
ret = JOURNAL_ERR_insufficient_devices;
209220
goto out;
210221
}

0 commit comments

Comments
 (0)