mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-23 23:32:30 -05:00
bcachefs: Ensure superblock gets written when we go ERO
When we go emergency read-only, make sure we do a final write_super() to persist counters and error counts - this can be critical for piecing together what fsck was doing. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
@@ -377,6 +377,11 @@ void bch2_fs_read_only(struct bch_fs *c)
|
||||
bch_verbose(c, "marking filesystem clean");
|
||||
bch2_fs_mark_clean(c);
|
||||
} else {
|
||||
/* Make sure error counts/counters are persisted */
|
||||
mutex_lock(&c->sb_lock);
|
||||
bch2_write_super(c);
|
||||
mutex_unlock(&c->sb_lock);
|
||||
|
||||
bch_verbose(c, "done going read-only, filesystem not clean");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user