]> Git Repo - J-linux.git/commitdiff
bcachefs: Ensure we're RW before journalling
authorKent Overstreet <[email protected]>
Thu, 23 May 2024 00:17:05 +0000 (20:17 -0400)
committerKent Overstreet <[email protected]>
Thu, 23 May 2024 00:17:33 +0000 (20:17 -0400)
Reported-by: [email protected]
Signed-off-by: Kent Overstreet <[email protected]>
fs/bcachefs/recovery.c

index 63f990f5c63a17e397401d9a1320d7bdf99db704..cf513fc79ce4809b368adfd90cddbf6a510642c3 100644 (file)
@@ -811,9 +811,11 @@ use_clean:
        clear_bit(BCH_FS_fsck_running, &c->flags);
 
        /* 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_meta(&c->journal);
+               bch2_write_ref_put(c, BCH_WRITE_REF_fsync);
        }
 
        /* If we fixed errors, verify that fs is actually clean now: */
This page took 0.083542 seconds and 4 git commands to generate.