diff options
author | Chao Yu <chao@kernel.org> | 2024-11-20 07:58:50 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2024-11-21 17:16:39 +0100 |
commit | 81520c684ca67aea6a589461a3caebb9b11dcc90 (patch) | |
tree | e83d117c09353fee4be4a51237fc4b5c47eaba54 /fs | |
parent | f2fs: clear SBI_POR_DOING before initing inmem curseg (diff) | |
download | linux-81520c684ca67aea6a589461a3caebb9b11dcc90.tar.xz linux-81520c684ca67aea6a589461a3caebb9b11dcc90.zip |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/f2fs/node.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 7d904f2bd5b6..0b900a7a48e5 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1338,7 +1338,12 @@ struct page *f2fs_new_node_page(struct dnode_of_data *dn, unsigned int ofs) err = -EFSCORRUPTED; dec_valid_node_count(sbi, dn->inode, !ofs); set_sbi_flag(sbi, SBI_NEED_FSCK); - f2fs_handle_error(sbi, ERROR_INVALID_BLKADDR); + f2fs_warn_ratelimited(sbi, + "f2fs_new_node_page: inconsistent nat entry, " + "ino:%u, nid:%u, blkaddr:%u, ver:%u, flag:%u", + new_ni.ino, new_ni.nid, new_ni.blk_addr, + new_ni.version, new_ni.flag); + f2fs_handle_error(sbi, ERROR_INCONSISTENT_NAT); goto fail; } #endif |