]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/sysfs.c
check if fs is mounted before running fsck
[bcachefs-tools-debian] / libbcachefs / sysfs.c
index b56db15daf118bfcd7ce8e3d3437051ff09000bb..a6d70ce524e91042ca3d426ca99c97f1f50dc1c2 100644 (file)
@@ -288,7 +288,7 @@ static ssize_t bch2_compression_stats(struct bch_fs *c, char *buf)
            compressed_sectors_compressed = 0,
            compressed_sectors_uncompressed = 0;
 
-       if (!bch2_fs_running(c))
+       if (!test_bit(BCH_FS_STARTED, &c->flags))
                return -EPERM;
 
        for_each_btree_key(&iter, c, BTREE_ID_EXTENTS, POS_MIN, 0, k)
@@ -481,7 +481,7 @@ STORE(__bch2_fs)
        BCH_DEBUG_PARAMS()
 #undef BCH_DEBUG_PARAM
 
-       if (!bch2_fs_running(c))
+       if (!test_bit(BCH_FS_STARTED, &c->flags))
                return -EPERM;
 
        /* Debugging: */