ext4: check s_chksum_driver when looking for bg csum presence
[firefly-linux-kernel-4.4.55.git] / fs / reiserfs / super.c
index debdb8e6726bc3e2c89e01211b1235f8c8938701..d46e88a33b02451d2cffc955a64c6752fab7c2cd 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/time.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 #include "reiserfs.h"
 #include "acl.h"
 #include "xattr.h"
@@ -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);