Commit 52c2db3f authored by Changman Lee's avatar Changman Lee Committed by 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: default avatarChangman Lee <cm224.lee@samsung.com>
Reviewed-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment