mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
bcachefs: Better write_super() error messages
When a superblock write is silently dropped or it's been modified by another process we need to know which device it was. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
74768337de
commit
6d82869185
@ -1020,26 +1020,35 @@ int bch2_write_super(struct bch_fs *c)
|
||||
continue;
|
||||
|
||||
if (le64_to_cpu(ca->sb_read_scratch->seq) < ca->disk_sb.seq) {
|
||||
bch2_fs_fatal_error(c,
|
||||
struct printbuf buf = PRINTBUF;
|
||||
prt_char(&buf, ' ');
|
||||
prt_bdevname(&buf, ca->disk_sb.bdev);
|
||||
prt_printf(&buf,
|
||||
": Superblock write was silently dropped! (seq %llu expected %llu)",
|
||||
le64_to_cpu(ca->sb_read_scratch->seq),
|
||||
ca->disk_sb.seq);
|
||||
percpu_ref_put(&ca->io_ref);
|
||||
bch2_fs_fatal_error(c, "%s", buf.buf);
|
||||
printbuf_exit(&buf);
|
||||
ret = -BCH_ERR_erofs_sb_err;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (le64_to_cpu(ca->sb_read_scratch->seq) > ca->disk_sb.seq) {
|
||||
bch2_fs_fatal_error(c,
|
||||
struct printbuf buf = PRINTBUF;
|
||||
prt_char(&buf, ' ');
|
||||
prt_bdevname(&buf, ca->disk_sb.bdev);
|
||||
prt_printf(&buf,
|
||||
": Superblock modified by another process (seq %llu expected %llu)",
|
||||
le64_to_cpu(ca->sb_read_scratch->seq),
|
||||
ca->disk_sb.seq);
|
||||
percpu_ref_put(&ca->io_ref);
|
||||
bch2_fs_fatal_error(c, "%s", buf.buf);
|
||||
printbuf_exit(&buf);
|
||||
ret = -BCH_ERR_erofs_sb_err;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
do {
|
||||
wrote = false;
|
||||
darray_for_each(online_devices, cap) {
|
||||
|
Loading…
Reference in New Issue
Block a user