aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/f2fs/checkpoint.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 1982fc7c1eea..b8614cf77cdd 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -1530,6 +1530,9 @@ int f2fs_write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
1530 unsigned long long ckpt_ver; 1530 unsigned long long ckpt_ver;
1531 int err = 0; 1531 int err = 0;
1532 1532
1533 if (f2fs_readonly(sbi->sb) || f2fs_hw_is_readonly(sbi))
1534 return -EROFS;
1535
1533 if (unlikely(is_sbi_flag_set(sbi, SBI_CP_DISABLED))) { 1536 if (unlikely(is_sbi_flag_set(sbi, SBI_CP_DISABLED))) {
1534 if (cpc->reason != CP_PAUSE) 1537 if (cpc->reason != CP_PAUSE)
1535 return 0; 1538 return 0;
@@ -1546,10 +1549,6 @@ int f2fs_write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
1546 err = -EIO; 1549 err = -EIO;
1547 goto out; 1550 goto out;
1548 } 1551 }
1549 if (f2fs_readonly(sbi->sb)) {
1550 err = -EROFS;
1551 goto out;
1552 }
1553 1552
1554 trace_f2fs_write_checkpoint(sbi->sb, cpc->reason, "start block_ops"); 1553 trace_f2fs_write_checkpoint(sbi->sb, cpc->reason, "start block_ops");
1555 1554