mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-06 04:19:23 -04:00
bcachefs: Improve error messages in superblock write path
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
committed by
Kent Overstreet
parent
2a84de3360
commit
bf15946316
@@ -754,11 +754,24 @@ int bch2_write_super(struct bch_fs *c)
|
||||
closure_sync(cl);
|
||||
|
||||
for_each_online_member(ca, c, i) {
|
||||
if (!ca->sb_write_error &&
|
||||
ca->disk_sb.seq !=
|
||||
le64_to_cpu(ca->sb_read_scratch->seq)) {
|
||||
if (ca->sb_write_error)
|
||||
continue;
|
||||
|
||||
if (le64_to_cpu(ca->sb_read_scratch->seq) < ca->disk_sb.seq) {
|
||||
bch2_fs_fatal_error(c,
|
||||
"Superblock modified by another process");
|
||||
"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);
|
||||
ret = -EROFS;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (le64_to_cpu(ca->sb_read_scratch->seq) > ca->disk_sb.seq) {
|
||||
bch2_fs_fatal_error(c,
|
||||
"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);
|
||||
ret = -EROFS;
|
||||
goto out;
|
||||
|
||||
Reference in New Issue
Block a user