f2fs: introduce f2fs_<level> macros to wrap f2fs_printk()
- Add and use f2fs_<level> macros - Convert f2fs_msg to f2fs_printk - Remove level from f2fs_printk and embed the level in the format - Coalesce formats and align multi-line arguments - Remove unnecessary duplicate extern f2fs_msg f2fs.h Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Chao Yu <yuchao0@huawei.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
26bc778b21
commit
ae8ba98776
14 changed files with 350 additions and 506 deletions
|
@ -146,8 +146,8 @@ static bool __is_bitmap_valid(struct f2fs_sb_info *sbi, block_t blkaddr,
|
|||
|
||||
exist = f2fs_test_bit(offset, se->cur_valid_map);
|
||||
if (!exist && type == DATA_GENERIC_ENHANCE) {
|
||||
f2fs_msg(sbi->sb, KERN_ERR, "Inconsistent error "
|
||||
"blkaddr:%u, sit bitmap:%d", blkaddr, exist);
|
||||
f2fs_err(sbi, "Inconsistent error blkaddr:%u, sit bitmap:%d",
|
||||
blkaddr, exist);
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
WARN_ON(1);
|
||||
}
|
||||
|
@ -184,8 +184,8 @@ bool f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
|
|||
case DATA_GENERIC_ENHANCE_READ:
|
||||
if (unlikely(blkaddr >= MAX_BLKADDR(sbi) ||
|
||||
blkaddr < MAIN_BLKADDR(sbi))) {
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"access invalid blkaddr:%u", blkaddr);
|
||||
f2fs_warn(sbi, "access invalid blkaddr:%u",
|
||||
blkaddr);
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
WARN_ON(1);
|
||||
return false;
|
||||
|
@ -657,9 +657,8 @@ static int recover_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino)
|
|||
|
||||
err_out:
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"%s: orphan failed (ino=%x), run fsck to fix.",
|
||||
__func__, ino);
|
||||
f2fs_warn(sbi, "%s: orphan failed (ino=%x), run fsck to fix.",
|
||||
__func__, ino);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -676,13 +675,12 @@ int f2fs_recover_orphan_inodes(struct f2fs_sb_info *sbi)
|
|||
return 0;
|
||||
|
||||
if (bdev_read_only(sbi->sb->s_bdev)) {
|
||||
f2fs_msg(sbi->sb, KERN_INFO, "write access "
|
||||
"unavailable, skipping orphan cleanup");
|
||||
f2fs_info(sbi, "write access unavailable, skipping orphan cleanup");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (s_flags & SB_RDONLY) {
|
||||
f2fs_msg(sbi->sb, KERN_INFO, "orphan cleanup on readonly fs");
|
||||
f2fs_info(sbi, "orphan cleanup on readonly fs");
|
||||
sbi->sb->s_flags &= ~SB_RDONLY;
|
||||
}
|
||||
|
||||
|
@ -827,15 +825,14 @@ static int get_checkpoint_version(struct f2fs_sb_info *sbi, block_t cp_addr,
|
|||
if (crc_offset < CP_MIN_CHKSUM_OFFSET ||
|
||||
crc_offset > CP_CHKSUM_OFFSET) {
|
||||
f2fs_put_page(*cp_page, 1);
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"invalid crc_offset: %zu", crc_offset);
|
||||
f2fs_warn(sbi, "invalid crc_offset: %zu", crc_offset);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
crc = f2fs_checkpoint_chksum(sbi, *cp_block);
|
||||
if (crc != cur_cp_crc(*cp_block)) {
|
||||
f2fs_put_page(*cp_page, 1);
|
||||
f2fs_msg(sbi->sb, KERN_WARNING, "invalid crc value");
|
||||
f2fs_warn(sbi, "invalid crc value");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -858,9 +855,8 @@ static struct page *validate_checkpoint(struct f2fs_sb_info *sbi,
|
|||
|
||||
if (le32_to_cpu(cp_block->cp_pack_total_block_count) >
|
||||
sbi->blocks_per_seg) {
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"invalid cp_pack_total_block_count:%u",
|
||||
le32_to_cpu(cp_block->cp_pack_total_block_count));
|
||||
f2fs_warn(sbi, "invalid cp_pack_total_block_count:%u",
|
||||
le32_to_cpu(cp_block->cp_pack_total_block_count));
|
||||
goto invalid_cp;
|
||||
}
|
||||
pre_version = *version;
|
||||
|
@ -1559,8 +1555,7 @@ int f2fs_write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
|
|||
if (unlikely(is_sbi_flag_set(sbi, SBI_CP_DISABLED))) {
|
||||
if (cpc->reason != CP_PAUSE)
|
||||
return 0;
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"Start checkpoint disabled!");
|
||||
f2fs_warn(sbi, "Start checkpoint disabled!");
|
||||
}
|
||||
mutex_lock(&sbi->cp_mutex);
|
||||
|
||||
|
@ -1626,8 +1621,7 @@ int f2fs_write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
|
|||
stat_inc_cp_count(sbi->stat_info);
|
||||
|
||||
if (cpc->reason & CP_RECOVERY)
|
||||
f2fs_msg(sbi->sb, KERN_NOTICE,
|
||||
"checkpoint: version = %llx", ckpt_ver);
|
||||
f2fs_notice(sbi, "checkpoint: version = %llx", ckpt_ver);
|
||||
|
||||
/* do checkpoint periodically */
|
||||
f2fs_update_time(sbi, CP_TIME);
|
||||
|
|
|
@ -218,9 +218,8 @@ struct f2fs_dir_entry *__f2fs_find_entry(struct inode *dir,
|
|||
|
||||
max_depth = F2FS_I(dir)->i_current_depth;
|
||||
if (unlikely(max_depth > MAX_DIR_HASH_DEPTH)) {
|
||||
f2fs_msg(F2FS_I_SB(dir)->sb, KERN_WARNING,
|
||||
"Corrupted max_depth of %lu: %u",
|
||||
dir->i_ino, max_depth);
|
||||
f2fs_warn(F2FS_I_SB(dir), "Corrupted max_depth of %lu: %u",
|
||||
dir->i_ino, max_depth);
|
||||
max_depth = MAX_DIR_HASH_DEPTH;
|
||||
f2fs_i_depth_write(dir, max_depth);
|
||||
}
|
||||
|
@ -816,9 +815,8 @@ int f2fs_fill_dentries(struct dir_context *ctx, struct f2fs_dentry_ptr *d,
|
|||
bit_pos += GET_DENTRY_SLOTS(le16_to_cpu(de->name_len));
|
||||
if (unlikely(bit_pos > d->max ||
|
||||
le16_to_cpu(de->name_len) > F2FS_NAME_LEN)) {
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"%s: corrupted namelen=%d, run fsck to fix.",
|
||||
__func__, le16_to_cpu(de->name_len));
|
||||
f2fs_warn(sbi, "%s: corrupted namelen=%d, run fsck to fix.",
|
||||
__func__, le16_to_cpu(de->name_len));
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
|
|
|
@ -184,10 +184,9 @@ bool f2fs_check_rb_tree_consistence(struct f2fs_sb_info *sbi,
|
|||
next_re = rb_entry(next, struct rb_entry, rb_node);
|
||||
|
||||
if (cur_re->ofs + cur_re->len > next_re->ofs) {
|
||||
f2fs_msg(sbi->sb, KERN_INFO, "inconsistent rbtree, "
|
||||
"cur(%u, %u) next(%u, %u)",
|
||||
cur_re->ofs, cur_re->len,
|
||||
next_re->ofs, next_re->len);
|
||||
f2fs_info(sbi, "inconsistent rbtree, cur(%u, %u) next(%u, %u)",
|
||||
cur_re->ofs, cur_re->len,
|
||||
next_re->ofs, next_re->len);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1809,7 +1809,20 @@ static inline int inc_valid_block_count(struct f2fs_sb_info *sbi,
|
|||
return -ENOSPC;
|
||||
}
|
||||
|
||||
void f2fs_msg(struct super_block *sb, const char *level, const char *fmt, ...);
|
||||
__printf(2, 3)
|
||||
void f2fs_printk(struct f2fs_sb_info *sbi, const char *fmt, ...);
|
||||
|
||||
#define f2fs_err(sbi, fmt, ...) \
|
||||
f2fs_printk(sbi, KERN_ERR fmt, ##__VA_ARGS__)
|
||||
#define f2fs_warn(sbi, fmt, ...) \
|
||||
f2fs_printk(sbi, KERN_WARNING fmt, ##__VA_ARGS__)
|
||||
#define f2fs_notice(sbi, fmt, ...) \
|
||||
f2fs_printk(sbi, KERN_NOTICE fmt, ##__VA_ARGS__)
|
||||
#define f2fs_info(sbi, fmt, ...) \
|
||||
f2fs_printk(sbi, KERN_INFO fmt, ##__VA_ARGS__)
|
||||
#define f2fs_debug(sbi, fmt, ...) \
|
||||
f2fs_printk(sbi, KERN_DEBUG fmt, ##__VA_ARGS__)
|
||||
|
||||
static inline void dec_valid_block_count(struct f2fs_sb_info *sbi,
|
||||
struct inode *inode,
|
||||
block_t count)
|
||||
|
@ -1825,11 +1838,10 @@ static inline void dec_valid_block_count(struct f2fs_sb_info *sbi,
|
|||
sbi->current_reserved_blocks + count);
|
||||
spin_unlock(&sbi->stat_lock);
|
||||
if (unlikely(inode->i_blocks < sectors)) {
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"Inconsistent i_blocks, ino:%lu, iblocks:%llu, sectors:%llu",
|
||||
inode->i_ino,
|
||||
(unsigned long long)inode->i_blocks,
|
||||
(unsigned long long)sectors);
|
||||
f2fs_warn(sbi, "Inconsistent i_blocks, ino:%lu, iblocks:%llu, sectors:%llu",
|
||||
inode->i_ino,
|
||||
(unsigned long long)inode->i_blocks,
|
||||
(unsigned long long)sectors);
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
return;
|
||||
}
|
||||
|
@ -2067,10 +2079,9 @@ static inline void dec_valid_node_count(struct f2fs_sb_info *sbi,
|
|||
dquot_free_inode(inode);
|
||||
} else {
|
||||
if (unlikely(inode->i_blocks == 0)) {
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"Inconsistent i_blocks, ino:%lu, iblocks:%llu",
|
||||
inode->i_ino,
|
||||
(unsigned long long)inode->i_blocks);
|
||||
f2fs_warn(sbi, "Inconsistent i_blocks, ino:%lu, iblocks:%llu",
|
||||
inode->i_ino,
|
||||
(unsigned long long)inode->i_blocks);
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
return;
|
||||
}
|
||||
|
@ -2840,9 +2851,8 @@ static inline void verify_blkaddr(struct f2fs_sb_info *sbi,
|
|||
block_t blkaddr, int type)
|
||||
{
|
||||
if (!f2fs_is_valid_blkaddr(sbi, blkaddr, type)) {
|
||||
f2fs_msg(sbi->sb, KERN_ERR,
|
||||
"invalid blkaddr: %u, type: %d, run fsck to fix.",
|
||||
blkaddr, type);
|
||||
f2fs_err(sbi, "invalid blkaddr: %u, type: %d, run fsck to fix.",
|
||||
blkaddr, type);
|
||||
f2fs_bug_on(sbi, 1);
|
||||
}
|
||||
}
|
||||
|
@ -2973,8 +2983,6 @@ int f2fs_quota_sync(struct super_block *sb, int type);
|
|||
void f2fs_quota_off_umount(struct super_block *sb);
|
||||
int f2fs_commit_super(struct f2fs_sb_info *sbi, bool recover);
|
||||
int f2fs_sync_fs(struct super_block *sb, int sync);
|
||||
extern __printf(3, 4)
|
||||
void f2fs_msg(struct super_block *sb, const char *level, const char *fmt, ...);
|
||||
int f2fs_sanity_check_ckpt(struct f2fs_sb_info *sbi);
|
||||
|
||||
/*
|
||||
|
|
|
@ -1837,9 +1837,8 @@ static int f2fs_ioc_start_atomic_write(struct file *filp)
|
|||
* f2fs_is_atomic_file.
|
||||
*/
|
||||
if (get_dirty_pages(inode))
|
||||
f2fs_msg(F2FS_I_SB(inode)->sb, KERN_WARNING,
|
||||
"Unexpected flush for atomic writes: ino=%lu, npages=%u",
|
||||
inode->i_ino, get_dirty_pages(inode));
|
||||
f2fs_warn(F2FS_I_SB(inode), "Unexpected flush for atomic writes: ino=%lu, npages=%u",
|
||||
inode->i_ino, get_dirty_pages(inode));
|
||||
ret = filemap_write_and_wait_range(inode->i_mapping, 0, LLONG_MAX);
|
||||
if (ret) {
|
||||
up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
|
||||
|
@ -2274,8 +2273,7 @@ static int f2fs_ioc_write_checkpoint(struct file *filp, unsigned long arg)
|
|||
return -EROFS;
|
||||
|
||||
if (unlikely(is_sbi_flag_set(sbi, SBI_CP_DISABLED))) {
|
||||
f2fs_msg(sbi->sb, KERN_INFO,
|
||||
"Skipping Checkpoint. Checkpoints currently disabled.");
|
||||
f2fs_info(sbi, "Skipping Checkpoint. Checkpoints currently disabled.");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -2660,10 +2658,8 @@ static int f2fs_ioc_flush_device(struct file *filp, unsigned long arg)
|
|||
|
||||
if (!f2fs_is_multi_device(sbi) || sbi->s_ndevs - 1 <= range.dev_num ||
|
||||
__is_large_section(sbi)) {
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"Can't flush %u in %d for segs_per_sec %u != 1",
|
||||
range.dev_num, sbi->s_ndevs,
|
||||
sbi->segs_per_sec);
|
||||
f2fs_warn(sbi, "Can't flush %u in %d for segs_per_sec %u != 1",
|
||||
range.dev_num, sbi->s_ndevs, sbi->segs_per_sec);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -2948,10 +2944,9 @@ int f2fs_pin_file_control(struct inode *inode, bool inc)
|
|||
fi->i_gc_failures[GC_FAILURE_PIN] + 1);
|
||||
|
||||
if (fi->i_gc_failures[GC_FAILURE_PIN] > sbi->gc_pin_file_threshold) {
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"%s: Enable GC = ino %lx after %x GC trials",
|
||||
__func__, inode->i_ino,
|
||||
fi->i_gc_failures[GC_FAILURE_PIN]);
|
||||
f2fs_warn(sbi, "%s: Enable GC = ino %lx after %x GC trials",
|
||||
__func__, inode->i_ino,
|
||||
fi->i_gc_failures[GC_FAILURE_PIN]);
|
||||
clear_inode_flag(inode, FI_PIN_FILE);
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
|
23
fs/f2fs/gc.c
23
fs/f2fs/gc.c
|
@ -618,9 +618,8 @@ static bool is_alive(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
|
|||
}
|
||||
|
||||
if (sum->version != dni->version) {
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"%s: valid data with mismatched node version.",
|
||||
__func__);
|
||||
f2fs_warn(sbi, "%s: valid data with mismatched node version.",
|
||||
__func__);
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
}
|
||||
|
||||
|
@ -1183,9 +1182,8 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi,
|
|||
|
||||
sum = page_address(sum_page);
|
||||
if (type != GET_SUM_TYPE((&sum->footer))) {
|
||||
f2fs_msg(sbi->sb, KERN_ERR, "Inconsistent segment (%u) "
|
||||
"type [%d, %d] in SSA and SIT",
|
||||
segno, type, GET_SUM_TYPE((&sum->footer)));
|
||||
f2fs_err(sbi, "Inconsistent segment (%u) type [%d, %d] in SSA and SIT",
|
||||
segno, type, GET_SUM_TYPE((&sum->footer)));
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
f2fs_stop_checkpoint(sbi, false);
|
||||
goto skip;
|
||||
|
@ -1397,8 +1395,8 @@ static int free_segment_range(struct f2fs_sb_info *sbi, unsigned int start,
|
|||
|
||||
next_inuse = find_next_inuse(FREE_I(sbi), end + 1, start);
|
||||
if (next_inuse <= end) {
|
||||
f2fs_msg(sbi->sb, KERN_ERR,
|
||||
"segno %u should be free but still inuse!", next_inuse);
|
||||
f2fs_err(sbi, "segno %u should be free but still inuse!",
|
||||
next_inuse);
|
||||
f2fs_bug_on(sbi, 1);
|
||||
}
|
||||
return err;
|
||||
|
@ -1455,14 +1453,12 @@ int f2fs_resize_fs(struct f2fs_sb_info *sbi, __u64 block_count)
|
|||
return 0;
|
||||
|
||||
if (is_sbi_flag_set(sbi, SBI_NEED_FSCK)) {
|
||||
f2fs_msg(sbi->sb, KERN_ERR,
|
||||
"Should run fsck to repair first.");
|
||||
f2fs_err(sbi, "Should run fsck to repair first.");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (test_opt(sbi, DISABLE_CHECKPOINT)) {
|
||||
f2fs_msg(sbi->sb, KERN_ERR,
|
||||
"Checkpoint should be enabled.");
|
||||
f2fs_err(sbi, "Checkpoint should be enabled.");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -1526,8 +1522,7 @@ int f2fs_resize_fs(struct f2fs_sb_info *sbi, __u64 block_count)
|
|||
out:
|
||||
if (err) {
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
f2fs_msg(sbi->sb, KERN_ERR,
|
||||
"resize_fs failed, should run fsck to repair!");
|
||||
f2fs_err(sbi, "resize_fs failed, should run fsck to repair!");
|
||||
|
||||
MAIN_SECS(sbi) += secs;
|
||||
spin_lock(&sbi->stat_lock);
|
||||
|
|
|
@ -140,10 +140,8 @@ int f2fs_convert_inline_page(struct dnode_of_data *dn, struct page *page)
|
|||
if (unlikely(dn->data_blkaddr != NEW_ADDR)) {
|
||||
f2fs_put_dnode(dn);
|
||||
set_sbi_flag(fio.sbi, SBI_NEED_FSCK);
|
||||
f2fs_msg(fio.sbi->sb, KERN_WARNING,
|
||||
"%s: corrupted inline inode ino=%lx, i_addr[0]:0x%x, "
|
||||
"run fsck to fix.",
|
||||
__func__, dn->inode->i_ino, dn->data_blkaddr);
|
||||
f2fs_warn(fio.sbi, "%s: corrupted inline inode ino=%lx, i_addr[0]:0x%x, run fsck to fix.",
|
||||
__func__, dn->inode->i_ino, dn->data_blkaddr);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -383,10 +381,8 @@ static int f2fs_move_inline_dirents(struct inode *dir, struct page *ipage,
|
|||
if (unlikely(dn.data_blkaddr != NEW_ADDR)) {
|
||||
f2fs_put_dnode(&dn);
|
||||
set_sbi_flag(F2FS_P_SB(page), SBI_NEED_FSCK);
|
||||
f2fs_msg(F2FS_P_SB(page)->sb, KERN_WARNING,
|
||||
"%s: corrupted inline inode ino=%lx, i_addr[0]:0x%x, "
|
||||
"run fsck to fix.",
|
||||
__func__, dir->i_ino, dn.data_blkaddr);
|
||||
f2fs_warn(F2FS_P_SB(page), "%s: corrupted inline inode ino=%lx, i_addr[0]:0x%x, run fsck to fix.",
|
||||
__func__, dir->i_ino, dn.data_blkaddr);
|
||||
err = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
@ -176,9 +176,8 @@ bool f2fs_inode_chksum_verify(struct f2fs_sb_info *sbi, struct page *page)
|
|||
calculated = f2fs_inode_chksum(sbi, page);
|
||||
|
||||
if (provided != calculated)
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"checksum invalid, nid = %lu, ino_of_node = %x, %x vs. %x",
|
||||
page->index, ino_of_node(page), provided, calculated);
|
||||
f2fs_warn(sbi, "checksum invalid, nid = %lu, ino_of_node = %x, %x vs. %x",
|
||||
page->index, ino_of_node(page), provided, calculated);
|
||||
|
||||
return provided == calculated;
|
||||
}
|
||||
|
@ -202,50 +201,41 @@ static bool sanity_check_inode(struct inode *inode, struct page *node_page)
|
|||
iblocks = le64_to_cpu(F2FS_INODE(node_page)->i_blocks);
|
||||
if (!iblocks) {
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"%s: corrupted inode i_blocks i_ino=%lx iblocks=%llu, "
|
||||
"run fsck to fix.",
|
||||
__func__, inode->i_ino, iblocks);
|
||||
f2fs_warn(sbi, "%s: corrupted inode i_blocks i_ino=%lx iblocks=%llu, run fsck to fix.",
|
||||
__func__, inode->i_ino, iblocks);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ino_of_node(node_page) != nid_of_node(node_page)) {
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"%s: corrupted inode footer i_ino=%lx, ino,nid: "
|
||||
"[%u, %u] run fsck to fix.",
|
||||
__func__, inode->i_ino,
|
||||
ino_of_node(node_page), nid_of_node(node_page));
|
||||
f2fs_warn(sbi, "%s: corrupted inode footer i_ino=%lx, ino,nid: [%u, %u] run fsck to fix.",
|
||||
__func__, inode->i_ino,
|
||||
ino_of_node(node_page), nid_of_node(node_page));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (f2fs_sb_has_flexible_inline_xattr(sbi)
|
||||
&& !f2fs_has_extra_attr(inode)) {
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"%s: corrupted inode ino=%lx, run fsck to fix.",
|
||||
__func__, inode->i_ino);
|
||||
f2fs_warn(sbi, "%s: corrupted inode ino=%lx, run fsck to fix.",
|
||||
__func__, inode->i_ino);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (f2fs_has_extra_attr(inode) &&
|
||||
!f2fs_sb_has_extra_attr(sbi)) {
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"%s: inode (ino=%lx) is with extra_attr, "
|
||||
"but extra_attr feature is off",
|
||||
__func__, inode->i_ino);
|
||||
f2fs_warn(sbi, "%s: inode (ino=%lx) is with extra_attr, but extra_attr feature is off",
|
||||
__func__, inode->i_ino);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (fi->i_extra_isize > F2FS_TOTAL_EXTRA_ATTR_SIZE ||
|
||||
fi->i_extra_isize % sizeof(__le32)) {
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"%s: inode (ino=%lx) has corrupted i_extra_isize: %d, "
|
||||
"max: %zu",
|
||||
__func__, inode->i_ino, fi->i_extra_isize,
|
||||
F2FS_TOTAL_EXTRA_ATTR_SIZE);
|
||||
f2fs_warn(sbi, "%s: inode (ino=%lx) has corrupted i_extra_isize: %d, max: %zu",
|
||||
__func__, inode->i_ino, fi->i_extra_isize,
|
||||
F2FS_TOTAL_EXTRA_ATTR_SIZE);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -255,11 +245,9 @@ static bool sanity_check_inode(struct inode *inode, struct page *node_page)
|
|||
(!fi->i_inline_xattr_size ||
|
||||
fi->i_inline_xattr_size > MAX_INLINE_XATTR_SIZE)) {
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"%s: inode (ino=%lx) has corrupted "
|
||||
"i_inline_xattr_size: %d, max: %zu",
|
||||
__func__, inode->i_ino, fi->i_inline_xattr_size,
|
||||
MAX_INLINE_XATTR_SIZE);
|
||||
f2fs_warn(sbi, "%s: inode (ino=%lx) has corrupted i_inline_xattr_size: %d, max: %zu",
|
||||
__func__, inode->i_ino, fi->i_inline_xattr_size,
|
||||
MAX_INLINE_XATTR_SIZE);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -272,11 +260,9 @@ static bool sanity_check_inode(struct inode *inode, struct page *node_page)
|
|||
!f2fs_is_valid_blkaddr(sbi, ei->blk + ei->len - 1,
|
||||
DATA_GENERIC_ENHANCE))) {
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"%s: inode (ino=%lx) extent info [%u, %u, %u] "
|
||||
"is incorrect, run fsck to fix",
|
||||
__func__, inode->i_ino,
|
||||
ei->blk, ei->fofs, ei->len);
|
||||
f2fs_warn(sbi, "%s: inode (ino=%lx) extent info [%u, %u, %u] is incorrect, run fsck to fix",
|
||||
__func__, inode->i_ino,
|
||||
ei->blk, ei->fofs, ei->len);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -284,19 +270,15 @@ static bool sanity_check_inode(struct inode *inode, struct page *node_page)
|
|||
if (f2fs_has_inline_data(inode) &&
|
||||
(!S_ISREG(inode->i_mode) && !S_ISLNK(inode->i_mode))) {
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"%s: inode (ino=%lx, mode=%u) should not have "
|
||||
"inline_data, run fsck to fix",
|
||||
__func__, inode->i_ino, inode->i_mode);
|
||||
f2fs_warn(sbi, "%s: inode (ino=%lx, mode=%u) should not have inline_data, run fsck to fix",
|
||||
__func__, inode->i_ino, inode->i_mode);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (f2fs_has_inline_dentry(inode) && !S_ISDIR(inode->i_mode)) {
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"%s: inode (ino=%lx, mode=%u) should not have "
|
||||
"inline_dentry, run fsck to fix",
|
||||
__func__, inode->i_ino, inode->i_mode);
|
||||
f2fs_warn(sbi, "%s: inode (ino=%lx, mode=%u) should not have inline_dentry, run fsck to fix",
|
||||
__func__, inode->i_ino, inode->i_mode);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -785,8 +767,7 @@ void f2fs_handle_failed_inode(struct inode *inode)
|
|||
err = f2fs_get_node_info(sbi, inode->i_ino, &ni);
|
||||
if (err) {
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"May loss orphan inode, run fsck to fix.");
|
||||
f2fs_warn(sbi, "May loss orphan inode, run fsck to fix.");
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -794,8 +775,7 @@ void f2fs_handle_failed_inode(struct inode *inode)
|
|||
err = f2fs_acquire_orphan_inode(sbi);
|
||||
if (err) {
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"Too many orphan inodes, run fsck to fix.");
|
||||
f2fs_warn(sbi, "Too many orphan inodes, run fsck to fix.");
|
||||
} else {
|
||||
f2fs_add_orphan_inode(inode);
|
||||
}
|
||||
|
|
|
@ -385,9 +385,8 @@ static int __recover_dot_dentries(struct inode *dir, nid_t pino)
|
|||
int err = 0;
|
||||
|
||||
if (f2fs_readonly(sbi->sb)) {
|
||||
f2fs_msg(sbi->sb, KERN_INFO,
|
||||
"skip recovering inline_dots inode (ino:%lu, pino:%u) "
|
||||
"in readonly mountpoint", dir->i_ino, pino);
|
||||
f2fs_info(sbi, "skip recovering inline_dots inode (ino:%lu, pino:%u) in readonly mountpoint",
|
||||
dir->i_ino, pino);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -480,9 +479,8 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
|
|||
if (IS_ENCRYPTED(dir) &&
|
||||
(S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)) &&
|
||||
!fscrypt_has_permitted_context(dir, inode)) {
|
||||
f2fs_msg(inode->i_sb, KERN_WARNING,
|
||||
"Inconsistent encryption contexts: %lu/%lu",
|
||||
dir->i_ino, inode->i_ino);
|
||||
f2fs_warn(F2FS_I_SB(inode), "Inconsistent encryption contexts: %lu/%lu",
|
||||
dir->i_ino, inode->i_ino);
|
||||
err = -EPERM;
|
||||
goto out_iput;
|
||||
}
|
||||
|
|
|
@ -34,9 +34,8 @@ int f2fs_check_nid_range(struct f2fs_sb_info *sbi, nid_t nid)
|
|||
{
|
||||
if (unlikely(nid < F2FS_ROOT_INO(sbi) || nid >= NM_I(sbi)->max_nid)) {
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"%s: out-of-range nid=%x, run fsck to fix.",
|
||||
__func__, nid);
|
||||
f2fs_warn(sbi, "%s: out-of-range nid=%x, run fsck to fix.",
|
||||
__func__, nid);
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
|
@ -1187,10 +1186,8 @@ int f2fs_remove_inode_page(struct inode *inode)
|
|||
}
|
||||
|
||||
if (unlikely(inode->i_blocks != 0 && inode->i_blocks != 8)) {
|
||||
f2fs_msg(F2FS_I_SB(inode)->sb, KERN_WARNING,
|
||||
"Inconsistent i_blocks, ino:%lu, iblocks:%llu",
|
||||
inode->i_ino,
|
||||
(unsigned long long)inode->i_blocks);
|
||||
f2fs_warn(F2FS_I_SB(inode), "Inconsistent i_blocks, ino:%lu, iblocks:%llu",
|
||||
inode->i_ino, (unsigned long long)inode->i_blocks);
|
||||
set_sbi_flag(F2FS_I_SB(inode), SBI_NEED_FSCK);
|
||||
}
|
||||
|
||||
|
@ -1380,11 +1377,10 @@ static struct page *__get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid,
|
|||
}
|
||||
page_hit:
|
||||
if(unlikely(nid != nid_of_node(page))) {
|
||||
f2fs_msg(sbi->sb, KERN_WARNING, "inconsistent node block, "
|
||||
"nid:%lu, node_footer[nid:%u,ino:%u,ofs:%u,cpver:%llu,blkaddr:%u]",
|
||||
nid, nid_of_node(page), ino_of_node(page),
|
||||
ofs_of_node(page), cpver_of_node(page),
|
||||
next_blkaddr_of_node(page));
|
||||
f2fs_warn(sbi, "inconsistent node block, nid:%lu, node_footer[nid:%u,ino:%u,ofs:%u,cpver:%llu,blkaddr:%u]",
|
||||
nid, nid_of_node(page), ino_of_node(page),
|
||||
ofs_of_node(page), cpver_of_node(page),
|
||||
next_blkaddr_of_node(page));
|
||||
err = -EINVAL;
|
||||
out_err:
|
||||
ClearPageUptodate(page);
|
||||
|
@ -1752,9 +1748,8 @@ int f2fs_fsync_node_pages(struct f2fs_sb_info *sbi, struct inode *inode,
|
|||
break;
|
||||
}
|
||||
if (!ret && atomic && !marked) {
|
||||
f2fs_msg(sbi->sb, KERN_DEBUG,
|
||||
"Retry to write fsync mark: ino=%u, idx=%lx",
|
||||
ino, last_page->index);
|
||||
f2fs_debug(sbi, "Retry to write fsync mark: ino=%u, idx=%lx",
|
||||
ino, last_page->index);
|
||||
lock_page(last_page);
|
||||
f2fs_wait_on_page_writeback(last_page, NODE, true, true);
|
||||
set_page_dirty(last_page);
|
||||
|
@ -2304,8 +2299,7 @@ static int __f2fs_build_free_nids(struct f2fs_sb_info *sbi,
|
|||
if (ret) {
|
||||
up_read(&nm_i->nat_tree_lock);
|
||||
f2fs_bug_on(sbi, !mount);
|
||||
f2fs_msg(sbi->sb, KERN_ERR,
|
||||
"NAT is corrupt, run fsck to fix it");
|
||||
f2fs_err(sbi, "NAT is corrupt, run fsck to fix it");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
@ -2915,7 +2909,7 @@ static int __get_nat_bitmaps(struct f2fs_sb_info *sbi)
|
|||
nm_i->full_nat_bits = nm_i->nat_bits + 8;
|
||||
nm_i->empty_nat_bits = nm_i->full_nat_bits + nat_bits_bytes;
|
||||
|
||||
f2fs_msg(sbi->sb, KERN_NOTICE, "Found nat_bits in checkpoint");
|
||||
f2fs_notice(sbi, "Found nat_bits in checkpoint");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -188,10 +188,9 @@ static int recover_dentry(struct inode *inode, struct page *ipage,
|
|||
name = "<encrypted>";
|
||||
else
|
||||
name = raw_inode->i_name;
|
||||
f2fs_msg(inode->i_sb, KERN_NOTICE,
|
||||
"%s: ino = %x, name = %s, dir = %lx, err = %d",
|
||||
__func__, ino_of_node(ipage), name,
|
||||
IS_ERR(dir) ? 0 : dir->i_ino, err);
|
||||
f2fs_notice(F2FS_I_SB(inode), "%s: ino = %x, name = %s, dir = %lx, err = %d",
|
||||
__func__, ino_of_node(ipage), name,
|
||||
IS_ERR(dir) ? 0 : dir->i_ino, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -292,9 +291,8 @@ static int recover_inode(struct inode *inode, struct page *page)
|
|||
else
|
||||
name = F2FS_INODE(page)->i_name;
|
||||
|
||||
f2fs_msg(inode->i_sb, KERN_NOTICE,
|
||||
"recover_inode: ino = %x, name = %s, inline = %x",
|
||||
ino_of_node(page), name, raw->i_inline);
|
||||
f2fs_notice(F2FS_I_SB(inode), "recover_inode: ino = %x, name = %s, inline = %x",
|
||||
ino_of_node(page), name, raw->i_inline);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -371,10 +369,9 @@ static int find_fsync_dnodes(struct f2fs_sb_info *sbi, struct list_head *head,
|
|||
/* sanity check in order to detect looped node chain */
|
||||
if (++loop_cnt >= free_blocks ||
|
||||
blkaddr == next_blkaddr_of_node(page)) {
|
||||
f2fs_msg(sbi->sb, KERN_NOTICE,
|
||||
"%s: detect looped node chain, "
|
||||
"blkaddr:%u, next:%u",
|
||||
__func__, blkaddr, next_blkaddr_of_node(page));
|
||||
f2fs_notice(sbi, "%s: detect looped node chain, blkaddr:%u, next:%u",
|
||||
__func__, blkaddr,
|
||||
next_blkaddr_of_node(page));
|
||||
f2fs_put_page(page, 1);
|
||||
err = -EINVAL;
|
||||
break;
|
||||
|
@ -553,10 +550,9 @@ static int do_recover_data(struct f2fs_sb_info *sbi, struct inode *inode,
|
|||
f2fs_bug_on(sbi, ni.ino != ino_of_node(page));
|
||||
|
||||
if (ofs_of_node(dn.node_page) != ofs_of_node(page)) {
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"Inconsistent ofs_of_node, ino:%lu, ofs:%u, %u",
|
||||
inode->i_ino, ofs_of_node(dn.node_page),
|
||||
ofs_of_node(page));
|
||||
f2fs_warn(sbi, "Inconsistent ofs_of_node, ino:%lu, ofs:%u, %u",
|
||||
inode->i_ino, ofs_of_node(dn.node_page),
|
||||
ofs_of_node(page));
|
||||
err = -EFAULT;
|
||||
goto err;
|
||||
}
|
||||
|
@ -642,11 +638,9 @@ static int do_recover_data(struct f2fs_sb_info *sbi, struct inode *inode,
|
|||
err:
|
||||
f2fs_put_dnode(&dn);
|
||||
out:
|
||||
f2fs_msg(sbi->sb, KERN_NOTICE,
|
||||
"recover_data: ino = %lx (i_size: %s) recovered = %d, err = %d",
|
||||
inode->i_ino,
|
||||
file_keep_isize(inode) ? "keep" : "recover",
|
||||
recovered, err);
|
||||
f2fs_notice(sbi, "recover_data: ino = %lx (i_size: %s) recovered = %d, err = %d",
|
||||
inode->i_ino, file_keep_isize(inode) ? "keep" : "recover",
|
||||
recovered, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -734,8 +728,7 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only)
|
|||
#endif
|
||||
|
||||
if (s_flags & SB_RDONLY) {
|
||||
f2fs_msg(sbi->sb, KERN_INFO,
|
||||
"recover fsync data on readonly fs");
|
||||
f2fs_info(sbi, "recover fsync data on readonly fs");
|
||||
sbi->sb->s_flags &= ~SB_RDONLY;
|
||||
}
|
||||
|
||||
|
|
|
@ -1757,8 +1757,7 @@ static int __f2fs_issue_discard_zone(struct f2fs_sb_info *sbi,
|
|||
devi = f2fs_target_device_index(sbi, blkstart);
|
||||
if (blkstart < FDEV(devi).start_blk ||
|
||||
blkstart > FDEV(devi).end_blk) {
|
||||
f2fs_msg(sbi->sb, KERN_ERR, "Invalid block %x",
|
||||
blkstart);
|
||||
f2fs_err(sbi, "Invalid block %x", blkstart);
|
||||
return -EIO;
|
||||
}
|
||||
blkstart -= FDEV(devi).start_blk;
|
||||
|
@ -1771,10 +1770,9 @@ static int __f2fs_issue_discard_zone(struct f2fs_sb_info *sbi,
|
|||
|
||||
if (sector & (bdev_zone_sectors(bdev) - 1) ||
|
||||
nr_sects != bdev_zone_sectors(bdev)) {
|
||||
f2fs_msg(sbi->sb, KERN_ERR,
|
||||
"(%d) %s: Unaligned zone reset attempted (block %x + %x)",
|
||||
devi, sbi->s_ndevs ? FDEV(devi).path: "",
|
||||
blkstart, blklen);
|
||||
f2fs_err(sbi, "(%d) %s: Unaligned zone reset attempted (block %x + %x)",
|
||||
devi, sbi->s_ndevs ? FDEV(devi).path : "",
|
||||
blkstart, blklen);
|
||||
return -EIO;
|
||||
}
|
||||
trace_f2fs_issue_reset_zone(bdev, blkstart);
|
||||
|
@ -2138,15 +2136,14 @@ static void update_sit_entry(struct f2fs_sb_info *sbi, block_t blkaddr, int del)
|
|||
mir_exist = f2fs_test_and_set_bit(offset,
|
||||
se->cur_valid_map_mir);
|
||||
if (unlikely(exist != mir_exist)) {
|
||||
f2fs_msg(sbi->sb, KERN_ERR, "Inconsistent error "
|
||||
"when setting bitmap, blk:%u, old bit:%d",
|
||||
blkaddr, exist);
|
||||
f2fs_err(sbi, "Inconsistent error when setting bitmap, blk:%u, old bit:%d",
|
||||
blkaddr, exist);
|
||||
f2fs_bug_on(sbi, 1);
|
||||
}
|
||||
#endif
|
||||
if (unlikely(exist)) {
|
||||
f2fs_msg(sbi->sb, KERN_ERR,
|
||||
"Bitmap was wrongly set, blk:%u", blkaddr);
|
||||
f2fs_err(sbi, "Bitmap was wrongly set, blk:%u",
|
||||
blkaddr);
|
||||
f2fs_bug_on(sbi, 1);
|
||||
se->valid_blocks--;
|
||||
del = 0;
|
||||
|
@ -2167,15 +2164,14 @@ static void update_sit_entry(struct f2fs_sb_info *sbi, block_t blkaddr, int del)
|
|||
mir_exist = f2fs_test_and_clear_bit(offset,
|
||||
se->cur_valid_map_mir);
|
||||
if (unlikely(exist != mir_exist)) {
|
||||
f2fs_msg(sbi->sb, KERN_ERR, "Inconsistent error "
|
||||
"when clearing bitmap, blk:%u, old bit:%d",
|
||||
blkaddr, exist);
|
||||
f2fs_err(sbi, "Inconsistent error when clearing bitmap, blk:%u, old bit:%d",
|
||||
blkaddr, exist);
|
||||
f2fs_bug_on(sbi, 1);
|
||||
}
|
||||
#endif
|
||||
if (unlikely(!exist)) {
|
||||
f2fs_msg(sbi->sb, KERN_ERR,
|
||||
"Bitmap was wrongly cleared, blk:%u", blkaddr);
|
||||
f2fs_err(sbi, "Bitmap was wrongly cleared, blk:%u",
|
||||
blkaddr);
|
||||
f2fs_bug_on(sbi, 1);
|
||||
se->valid_blocks++;
|
||||
del = 0;
|
||||
|
@ -2683,9 +2679,8 @@ void allocate_segment_for_resize(struct f2fs_sb_info *sbi, int type,
|
|||
up_write(&SIT_I(sbi)->sentry_lock);
|
||||
|
||||
if (segno != curseg->segno)
|
||||
f2fs_msg(sbi->sb, KERN_NOTICE,
|
||||
"For resize: curseg of type %d: %u ==> %u",
|
||||
type, segno, curseg->segno);
|
||||
f2fs_notice(sbi, "For resize: curseg of type %d: %u ==> %u",
|
||||
type, segno, curseg->segno);
|
||||
|
||||
mutex_unlock(&curseg->curseg_mutex);
|
||||
up_read(&SM_I(sbi)->curseg_lock);
|
||||
|
@ -2823,8 +2818,7 @@ int f2fs_trim_fs(struct f2fs_sb_info *sbi, struct fstrim_range *range)
|
|||
goto out;
|
||||
|
||||
if (is_sbi_flag_set(sbi, SBI_NEED_FSCK)) {
|
||||
f2fs_msg(sbi->sb, KERN_WARNING,
|
||||
"Found FS corruption, run fsck to fix.");
|
||||
f2fs_warn(sbi, "Found FS corruption, run fsck to fix.");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
|
@ -3585,9 +3579,8 @@ static int restore_curseg_summaries(struct f2fs_sb_info *sbi)
|
|||
/* sanity check for summary blocks */
|
||||
if (nats_in_cursum(nat_j) > NAT_JOURNAL_ENTRIES ||
|
||||
sits_in_cursum(sit_j) > SIT_JOURNAL_ENTRIES) {
|
||||
f2fs_msg(sbi->sb, KERN_ERR,
|
||||
"invalid journal entries nats %u sits %u\n",
|
||||
nats_in_cursum(nat_j), sits_in_cursum(sit_j));
|
||||
f2fs_err(sbi, "invalid journal entries nats %u sits %u\n",
|
||||
nats_in_cursum(nat_j), sits_in_cursum(sit_j));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -4155,9 +4148,8 @@ static int build_sit_entries(struct f2fs_sb_info *sbi)
|
|||
|
||||
start = le32_to_cpu(segno_in_journal(journal, i));
|
||||
if (start >= MAIN_SEGS(sbi)) {
|
||||
f2fs_msg(sbi->sb, KERN_ERR,
|
||||
"Wrong journal entry on segno %u",
|
||||
start);
|
||||
f2fs_err(sbi, "Wrong journal entry on segno %u",
|
||||
start);
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
err = -EINVAL;
|
||||
break;
|
||||
|
@ -4196,9 +4188,8 @@ static int build_sit_entries(struct f2fs_sb_info *sbi)
|
|||
up_read(&curseg->journal_rwsem);
|
||||
|
||||
if (!err && total_node_blocks != valid_node_count(sbi)) {
|
||||
f2fs_msg(sbi->sb, KERN_ERR,
|
||||
"SIT is corrupted node# %u vs %u",
|
||||
total_node_blocks, valid_node_count(sbi));
|
||||
f2fs_err(sbi, "SIT is corrupted node# %u vs %u",
|
||||
total_node_blocks, valid_node_count(sbi));
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
err = -EINVAL;
|
||||
}
|
||||
|
@ -4314,12 +4305,10 @@ static int sanity_check_curseg(struct f2fs_sb_info *sbi)
|
|||
if (!f2fs_test_bit(blkofs, se->cur_valid_map))
|
||||
continue;
|
||||
out:
|
||||
f2fs_msg(sbi->sb, KERN_ERR,
|
||||
"Current segment's next free block offset is "
|
||||
"inconsistent with bitmap, logtype:%u, "
|
||||
"segno:%u, type:%u, next_blkoff:%u, blkofs:%u",
|
||||
i, curseg->segno, curseg->alloc_type,
|
||||
curseg->next_blkoff, blkofs);
|
||||
f2fs_err(sbi,
|
||||
"Current segment's next free block offset is inconsistent with bitmap, logtype:%u, segno:%u, type:%u, next_blkoff:%u, blkofs:%u",
|
||||
i, curseg->segno, curseg->alloc_type,
|
||||
curseg->next_blkoff, blkofs);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -693,9 +693,8 @@ static inline int check_block_count(struct f2fs_sb_info *sbi,
|
|||
} while (cur_pos < sbi->blocks_per_seg);
|
||||
|
||||
if (unlikely(GET_SIT_VBLOCKS(raw_sit) != valid_blocks)) {
|
||||
f2fs_msg(sbi->sb, KERN_ERR,
|
||||
"Mismatch valid blocks %d vs. %d",
|
||||
GET_SIT_VBLOCKS(raw_sit), valid_blocks);
|
||||
f2fs_err(sbi, "Mismatch valid blocks %d vs. %d",
|
||||
GET_SIT_VBLOCKS(raw_sit), valid_blocks);
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -703,9 +702,8 @@ static inline int check_block_count(struct f2fs_sb_info *sbi,
|
|||
/* check segment usage, and check boundary of a given segment number */
|
||||
if (unlikely(GET_SIT_VBLOCKS(raw_sit) > sbi->blocks_per_seg
|
||||
|| segno > TOTAL_SEGS(sbi) - 1)) {
|
||||
f2fs_msg(sbi->sb, KERN_ERR,
|
||||
"Wrong valid blocks %d or segno %u",
|
||||
GET_SIT_VBLOCKS(raw_sit), segno);
|
||||
f2fs_err(sbi, "Wrong valid blocks %d or segno %u",
|
||||
GET_SIT_VBLOCKS(raw_sit), segno);
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
491
fs/f2fs/super.c
491
fs/f2fs/super.c
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue