fs/ntfs3: ntfs3_forced_shutdown use int instead of bool
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Fri, 24 Nov 2023 09:21:12 +0000 (12:21 +0300)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Wed, 6 Dec 2023 14:46:14 +0000 (17:46 +0300)
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/fsntfs.c
fs/ntfs3/ntfs_fs.h
fs/ntfs3/super.c

index fbfe21dbb42597cdb25a6d809f7b396e37508046..350461d8cece5fc17ea4bb6d7a4749ee6d3a6dae 100644 (file)
@@ -853,7 +853,8 @@ void ntfs_update_mftmirr(struct ntfs_sb_info *sbi, int wait)
        /*
         * sb can be NULL here. In this case sbi->flags should be 0 too.
         */
-       if (!sb || !(sbi->flags & NTFS_FLAGS_MFTMIRR))
+       if (!sb || !(sbi->flags & NTFS_FLAGS_MFTMIRR) ||
+           unlikely(ntfs3_forced_shutdown(sb)))
                return;
 
        blocksize = sb->s_blocksize;
index d40bc7669ae588c76984cc3308b105cee37f7960..7510875efef6abe00837e9d232d2f240c52c5fda 100644 (file)
@@ -62,7 +62,7 @@ enum utf16_endian;
 /* sbi->flags */
 #define NTFS_FLAGS_NODISCARD           0x00000001
 /* ntfs in shutdown state. */
-#define NTFS_FLAGS_SHUTDOWN            0x00000002
+#define NTFS_FLAGS_SHUTDOWN_BIT                0x00000002  /* == 4*/
 /* Set when LogFile is replaying. */
 #define NTFS_FLAGS_LOG_REPLAYING       0x00000008
 /* Set when we changed first MFT's which copy must be updated in $MftMirr. */
@@ -1001,9 +1001,9 @@ static inline struct ntfs_sb_info *ntfs_sb(struct super_block *sb)
        return sb->s_fs_info;
 }
 
-static inline bool ntfs3_forced_shutdown(struct super_block *sb)
+static inline int ntfs3_forced_shutdown(struct super_block *sb)
 {
-       return test_bit(NTFS_FLAGS_SHUTDOWN, &ntfs_sb(sb)->flags);
+       return test_bit(NTFS_FLAGS_SHUTDOWN_BIT, &ntfs_sb(sb)->flags);
 }
 
 /*
index af8521a6ed954efb1af51a2305bae16b8f843352..65ef4b57411f0e81e0d477dcdb1624ae280fd464 100644 (file)
@@ -719,7 +719,7 @@ static int ntfs_show_options(struct seq_file *m, struct dentry *root)
  */
 static void ntfs_shutdown(struct super_block *sb)
 {
-       set_bit(NTFS_FLAGS_SHUTDOWN, &ntfs_sb(sb)->flags);
+       set_bit(NTFS_FLAGS_SHUTDOWN_BIT, &ntfs_sb(sb)->flags);
 }
 
 /*