瀏覽代碼

f2fs: avoid write_checkpoint if f2fs is mounted readonly

Do not change any partition when f2fs is changed to readonly mode.

Reviewed-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Jaegeuk Kim 10 年之前
父節點
當前提交
11504a8e7e
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      fs/f2fs/checkpoint.c

+ 2 - 0
fs/f2fs/checkpoint.c

@@ -1067,6 +1067,8 @@ void write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
 		goto out;
 		goto out;
 	if (unlikely(f2fs_cp_error(sbi)))
 	if (unlikely(f2fs_cp_error(sbi)))
 		goto out;
 		goto out;
+	if (f2fs_readonly(sbi->sb))
+		goto out;
 	if (block_operations(sbi))
 	if (block_operations(sbi))
 		goto out;
 		goto out;