OSDN Git Service

f2fs: stop issuing discard if fs is readonly
authorChao Yu <yuchao0@huawei.com>
Thu, 25 Jan 2018 10:57:27 +0000 (18:57 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 8 Feb 2018 02:06:10 +0000 (18:06 -0800)
If filesystem is readonly, stop to issue discard in daemon.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.c

index 31c69c6..6662c6c 100644 (file)
@@ -1486,6 +1486,8 @@ static int issue_discard_thread(void *data)
                                msecs_to_jiffies(wait_ms));
                if (try_to_freeze())
                        continue;
+               if (f2fs_readonly(sbi->sb))
+                       continue;
                if (kthread_should_stop())
                        return 0;