mirror of https://gitee.com/openkylin/linux.git
f2fs: return early when trying to read null nid
If get_node_page() gets zero nid, we can return early without getting a wrong page. For example, get_dnode_of_data() can try to do that. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
2aadac085c
commit
4aa69d5667
|
@ -1059,6 +1059,10 @@ struct page *get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid)
|
|||
{
|
||||
struct page *page;
|
||||
int err;
|
||||
|
||||
if (!nid)
|
||||
return ERR_PTR(-ENOENT);
|
||||
f2fs_bug_on(sbi, check_nid_range(sbi, nid));
|
||||
repeat:
|
||||
page = grab_cache_page(NODE_MAPPING(sbi), nid);
|
||||
if (!page)
|
||||
|
|
Loading…
Reference in New Issue