提交 52c2db3f 编写于 作者: C Changman Lee 提交者: Jaegeuk Kim

f2fs: check the level before calling get_nid function

The caller of get_nid should be careful not to put lower value than
NODE_DIR1_BLOCK in case of level is zero.
Signed-off-by: NChangman Lee <cm224.lee@samsung.com>
Reviewed-by: NNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
上级 266e97a8
...@@ -403,7 +403,8 @@ int get_dnode_of_data(struct dnode_of_data *dn, pgoff_t index, int mode) ...@@ -403,7 +403,8 @@ int get_dnode_of_data(struct dnode_of_data *dn, pgoff_t index, int mode)
return PTR_ERR(npage[0]); return PTR_ERR(npage[0]);
parent = npage[0]; parent = npage[0];
nids[1] = get_nid(parent, offset[0], true); if (level != 0)
nids[1] = get_nid(parent, offset[0], true);
dn->inode_page = npage[0]; dn->inode_page = npage[0];
dn->inode_page_locked = true; dn->inode_page_locked = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册