ext4: check s_chksum_driver when looking for bg csum presence
[firefly-linux-kernel-4.4.55.git] / fs / reiserfs / super.c
index 709ea92d716f03ca78b7e45b6f2677ac50b3ba1d..d46e88a33b02451d2cffc955a64c6752fab7c2cd 100644 (file)
@@ -100,7 +100,11 @@ void reiserfs_schedule_old_flush(struct super_block *s)
        struct reiserfs_sb_info *sbi = REISERFS_SB(s);
        unsigned long delay;
 
-       if (s->s_flags & MS_RDONLY)
+       /*
+        * Avoid scheduling flush when sb is being shut down. It can race
+        * with journal shutdown and free still queued delayed work.
+        */
+       if (s->s_flags & MS_RDONLY || !(s->s_flags & MS_ACTIVE))
                return;
 
        spin_lock(&sbi->old_work_lock);