1
0
Fork 0

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: Changman Lee <cm224.lee@samsung.com>
Reviewed-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
hifive-unleashed-5.1
Changman Lee 2013-02-20 07:47:06 +09:00 committed by Jaegeuk Kim
parent 266e97a81c
commit 52c2db3f95
1 changed files with 2 additions and 1 deletions

View File

@ -403,7 +403,8 @@ int get_dnode_of_data(struct dnode_of_data *dn, pgoff_t index, int mode)
return PTR_ERR(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_locked = true;