Skip to content

Commit 81520c6

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: print message if fscorrupted was found in f2fs_new_node_page()
If fs corruption occurs in f2fs_new_node_page(), let's print more information about corrupted metadata into kernel log. Meanwhile, it updates to record ERROR_INCONSISTENT_NAT instead of ERROR_INVALID_BLKADDR if blkaddr in nat entry is not NULL_ADDR which means nat bitmap and nat entry is inconsistent. Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent f88c790 commit 81520c6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

fs/f2fs/node.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1338,7 +1338,12 @@ struct page *f2fs_new_node_page(struct dnode_of_data *dn, unsigned int ofs)
13381338
err = -EFSCORRUPTED;
13391339
dec_valid_node_count(sbi, dn->inode, !ofs);
13401340
set_sbi_flag(sbi, SBI_NEED_FSCK);
1341-
f2fs_handle_error(sbi, ERROR_INVALID_BLKADDR);
1341+
f2fs_warn_ratelimited(sbi,
1342+
"f2fs_new_node_page: inconsistent nat entry, "
1343+
"ino:%u, nid:%u, blkaddr:%u, ver:%u, flag:%u",
1344+
new_ni.ino, new_ni.nid, new_ni.blk_addr,
1345+
new_ni.version, new_ni.flag);
1346+
f2fs_handle_error(sbi, ERROR_INCONSISTENT_NAT);
13421347
goto fail;
13431348
}
13441349
#endif

0 commit comments

Comments
 (0)