• Yunlong Song's avatar
    f2fs: return the errno to the caller to avoid using a wrong page · 0c9df7fb
    Yunlong Song authored
    Commit aaf96075 ("f2fs: check node page
    contents all the time") pointed out that "sometimes it was reported that
    its contents was missing", so it checks the page's mapping and contents.
    When "nid != nid_of_node(page)", ERR_PTR(-EIO) will be returned to the
    caller. However, commit e1c51b9f ("f2fs:
    clean up node page updating flow") moves "nid != nid_of_node(page)" test
    to "f2fs_bug_on(sbi, nid != nid_of_node(page))", this will return a
    wrong page to the caller when F2FS_CHECK_FS is off when "sometimes it
    was reported that its contents was missing" happens.
    
    This patch restores to check node page contents all the time, and
    returns the errno to make the caller known something is wrong and avoid
    to use the page. This patch also moves f2fs_bug_on to its proper location.
    Signed-off-by: default avatarYunlong Song <yunlong.song@huawei.com>
    Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    0c9df7fb
node.c 56.2 KB