aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/f2fs/checkpoint.c6
-rw-r--r--fs/f2fs/super.c15
2 files changed, 17 insertions, 4 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index d52a15799488..1982fc7c1eea 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -644,6 +644,12 @@ int f2fs_recover_orphan_inodes(struct f2fs_sb_info *sbi)
644 if (!is_set_ckpt_flags(sbi, CP_ORPHAN_PRESENT_FLAG)) 644 if (!is_set_ckpt_flags(sbi, CP_ORPHAN_PRESENT_FLAG))
645 return 0; 645 return 0;
646 646
647 if (bdev_read_only(sbi->sb->s_bdev)) {
648 f2fs_msg(sbi->sb, KERN_INFO, "write access "
649 "unavailable, skipping orphan cleanup");
650 return 0;
651 }
652
647 if (s_flags & SB_RDONLY) { 653 if (s_flags & SB_RDONLY) {
648 f2fs_msg(sbi->sb, KERN_INFO, "orphan cleanup on readonly fs"); 654 f2fs_msg(sbi->sb, KERN_INFO, "orphan cleanup on readonly fs");
649 sbi->sb->s_flags &= ~SB_RDONLY; 655 sbi->sb->s_flags &= ~SB_RDONLY;
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 29d985cf8301..4f8e9ab48b26 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -3377,10 +3377,17 @@ try_onemore:
3377 * mount should be failed, when device has readonly mode, and 3377 * mount should be failed, when device has readonly mode, and
3378 * previous checkpoint was not done by clean system shutdown. 3378 * previous checkpoint was not done by clean system shutdown.
3379 */ 3379 */
3380 if (f2fs_hw_is_readonly(sbi) && 3380 if (f2fs_hw_is_readonly(sbi)) {
3381 !is_set_ckpt_flags(sbi, CP_UMOUNT_FLAG)) { 3381 if (!is_set_ckpt_flags(sbi, CP_UMOUNT_FLAG)) {
3382 err = -EROFS; 3382 err = -EROFS;
3383 goto free_meta; 3383 f2fs_msg(sb, KERN_ERR,
3384 "Need to recover fsync data, but "
3385 "write access unavailable");
3386 goto free_meta;
3387 }
3388 f2fs_msg(sbi->sb, KERN_INFO, "write access "
3389 "unavailable, skipping recovery");
3390 goto reset_checkpoint;
3384 } 3391 }
3385 3392
3386 if (need_fsck) 3393 if (need_fsck)