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>
This commit is contained in:
parent
266e97a81c
commit
52c2db3f95
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user