summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/checkpoint.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/f2fs/checkpoint.c')
-rw-r--r--fs/f2fs/checkpoint.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 7b4a0fd59512..a5ae1ef1a6d0 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -146,8 +146,8 @@ static bool __is_bitmap_valid(struct f2fs_sb_info *sbi, block_t blkaddr,
146 146
147 exist = f2fs_test_bit(offset, se->cur_valid_map); 147 exist = f2fs_test_bit(offset, se->cur_valid_map);
148 if (!exist && type == DATA_GENERIC_ENHANCE) { 148 if (!exist && type == DATA_GENERIC_ENHANCE) {
149 f2fs_msg(sbi->sb, KERN_ERR, "Inconsistent error " 149 f2fs_err(sbi, "Inconsistent error blkaddr:%u, sit bitmap:%d",
150 "blkaddr:%u, sit bitmap:%d", blkaddr, exist); 150 blkaddr, exist);
151 set_sbi_flag(sbi, SBI_NEED_FSCK); 151 set_sbi_flag(sbi, SBI_NEED_FSCK);
152 WARN_ON(1); 152 WARN_ON(1);
153 } 153 }
@@ -184,8 +184,8 @@ bool f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
184 case DATA_GENERIC_ENHANCE_READ: 184 case DATA_GENERIC_ENHANCE_READ:
185 if (unlikely(blkaddr >= MAX_BLKADDR(sbi) || 185 if (unlikely(blkaddr >= MAX_BLKADDR(sbi) ||
186 blkaddr < MAIN_BLKADDR(sbi))) { 186 blkaddr < MAIN_BLKADDR(sbi))) {
187 f2fs_msg(sbi->sb, KERN_WARNING, 187 f2fs_warn(sbi, "access invalid blkaddr:%u",
188 "access invalid blkaddr:%u", blkaddr); 188 blkaddr);
189 set_sbi_flag(sbi, SBI_NEED_FSCK); 189 set_sbi_flag(sbi, SBI_NEED_FSCK);
190 WARN_ON(1); 190 WARN_ON(1);
191 return false; 191 return false;
@@ -657,9 +657,8 @@ static int recover_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino)
657 657
658err_out: 658err_out:
659 set_sbi_flag(sbi, SBI_NEED_FSCK); 659 set_sbi_flag(sbi, SBI_NEED_FSCK);
660 f2fs_msg(sbi->sb, KERN_WARNING, 660 f2fs_warn(sbi, "%s: orphan failed (ino=%x), run fsck to fix.",
661 "%s: orphan failed (ino=%x), run fsck to fix.", 661 __func__, ino);
662 __func__, ino);
663 return err; 662 return err;
664} 663}
665 664
@@ -676,13 +675,12 @@ int f2fs_recover_orphan_inodes(struct f2fs_sb_info *sbi)
676 return 0; 675 return 0;
677 676
678 if (bdev_read_only(sbi->sb->s_bdev)) { 677 if (bdev_read_only(sbi->sb->s_bdev)) {
679 f2fs_msg(sbi->sb, KERN_INFO, "write access " 678 f2fs_info(sbi, "write access unavailable, skipping orphan cleanup");
680 "unavailable, skipping orphan cleanup");
681 return 0; 679 return 0;
682 } 680 }
683 681
684 if (s_flags & SB_RDONLY) { 682 if (s_flags & SB_RDONLY) {
685 f2fs_msg(sbi->sb, KERN_INFO, "orphan cleanup on readonly fs"); 683 f2fs_info(sbi, "orphan cleanup on readonly fs");
686 sbi->sb->s_flags &= ~SB_RDONLY; 684 sbi->sb->s_flags &= ~SB_RDONLY;
687 } 685 }
688 686
@@ -827,15 +825,14 @@ static int get_checkpoint_version(struct f2fs_sb_info *sbi, block_t cp_addr,
827 if (crc_offset < CP_MIN_CHKSUM_OFFSET || 825 if (crc_offset < CP_MIN_CHKSUM_OFFSET ||
828 crc_offset > CP_CHKSUM_OFFSET) { 826 crc_offset > CP_CHKSUM_OFFSET) {
829 f2fs_put_page(*cp_page, 1); 827 f2fs_put_page(*cp_page, 1);
830 f2fs_msg(sbi->sb, KERN_WARNING, 828 f2fs_warn(sbi, "invalid crc_offset: %zu", crc_offset);
831 "invalid crc_offset: %zu", crc_offset);
832 return -EINVAL; 829 return -EINVAL;
833 } 830 }
834 831
835 crc = f2fs_checkpoint_chksum(sbi, *cp_block); 832 crc = f2fs_checkpoint_chksum(sbi, *cp_block);
836 if (crc != cur_cp_crc(*cp_block)) { 833 if (crc != cur_cp_crc(*cp_block)) {
837 f2fs_put_page(*cp_page, 1); 834 f2fs_put_page(*cp_page, 1);
838 f2fs_msg(sbi->sb, KERN_WARNING, "invalid crc value"); 835 f2fs_warn(sbi, "invalid crc value");
839 return -EINVAL; 836 return -EINVAL;
840 } 837 }
841 838
@@ -858,9 +855,8 @@ static struct page *validate_checkpoint(struct f2fs_sb_info *sbi,
858 855
859 if (le32_to_cpu(cp_block->cp_pack_total_block_count) > 856 if (le32_to_cpu(cp_block->cp_pack_total_block_count) >
860 sbi->blocks_per_seg) { 857 sbi->blocks_per_seg) {
861 f2fs_msg(sbi->sb, KERN_WARNING, 858 f2fs_warn(sbi, "invalid cp_pack_total_block_count:%u",
862 "invalid cp_pack_total_block_count:%u", 859 le32_to_cpu(cp_block->cp_pack_total_block_count));
863 le32_to_cpu(cp_block->cp_pack_total_block_count));
864 goto invalid_cp; 860 goto invalid_cp;
865 } 861 }
866 pre_version = *version; 862 pre_version = *version;
@@ -1559,8 +1555,7 @@ int f2fs_write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
1559 if (unlikely(is_sbi_flag_set(sbi, SBI_CP_DISABLED))) { 1555 if (unlikely(is_sbi_flag_set(sbi, SBI_CP_DISABLED))) {
1560 if (cpc->reason != CP_PAUSE) 1556 if (cpc->reason != CP_PAUSE)
1561 return 0; 1557 return 0;
1562 f2fs_msg(sbi->sb, KERN_WARNING, 1558 f2fs_warn(sbi, "Start checkpoint disabled!");
1563 "Start checkpoint disabled!");
1564 } 1559 }
1565 mutex_lock(&sbi->cp_mutex); 1560 mutex_lock(&sbi->cp_mutex);
1566 1561
@@ -1626,8 +1621,7 @@ stop:
1626 stat_inc_cp_count(sbi->stat_info); 1621 stat_inc_cp_count(sbi->stat_info);
1627 1622
1628 if (cpc->reason & CP_RECOVERY) 1623 if (cpc->reason & CP_RECOVERY)
1629 f2fs_msg(sbi->sb, KERN_NOTICE, 1624 f2fs_notice(sbi, "checkpoint: version = %llx", ckpt_ver);
1630 "checkpoint: version = %llx", ckpt_ver);
1631 1625
1632 /* do checkpoint periodically */ 1626 /* do checkpoint periodically */
1633 f2fs_update_time(sbi, CP_TIME); 1627 f2fs_update_time(sbi, CP_TIME);