bcachefs: Fix for shutting down before fs started marking it clean
authorKent Overstreet <kent.overstreet@gmail.com>
Sat, 9 Mar 2019 19:53:03 +0000 (14:53 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:17 +0000 (17:08 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/super.c

index c79aa11f2120fec2ebcdfc11c27c7e6fffe2a610..4f627e91f04162fc3d4a9e3ddb2f7bb6a254cc72 100644 (file)
@@ -299,7 +299,8 @@ void bch2_fs_read_only(struct bch_fs *c)
 
        if (!bch2_journal_error(&c->journal) &&
            !test_bit(BCH_FS_ERROR, &c->flags) &&
-           !test_bit(BCH_FS_EMERGENCY_RO, &c->flags))
+           !test_bit(BCH_FS_EMERGENCY_RO, &c->flags) &&
+           test_bit(BCH_FS_STARTED, &c->flags))
                bch2_fs_mark_clean(c, true);
 
        if (c->state != BCH_FS_STOPPING)