mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-17 18:56:24 +00:00
bcachefs: Ensure we're RW before journalling
Reported-by: syzbot+c60cd352aedb109528bf@syzkaller.appspotmail.com Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
d293ece108
commit
cd3b31f9d4
@ -811,9 +811,11 @@ use_clean:
|
|||||||
clear_bit(BCH_FS_fsck_running, &c->flags);
|
clear_bit(BCH_FS_fsck_running, &c->flags);
|
||||||
|
|
||||||
/* fsync if we fixed errors */
|
/* fsync if we fixed errors */
|
||||||
if (test_bit(BCH_FS_errors_fixed, &c->flags)) {
|
if (test_bit(BCH_FS_errors_fixed, &c->flags) &&
|
||||||
|
bch2_write_ref_tryget(c, BCH_WRITE_REF_fsync)) {
|
||||||
bch2_journal_flush_all_pins(&c->journal);
|
bch2_journal_flush_all_pins(&c->journal);
|
||||||
bch2_journal_meta(&c->journal);
|
bch2_journal_meta(&c->journal);
|
||||||
|
bch2_write_ref_put(c, BCH_WRITE_REF_fsync);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we fixed errors, verify that fs is actually clean now: */
|
/* If we fixed errors, verify that fs is actually clean now: */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user