aboutsummaryrefslogtreecommitdiff
path: root/fs/f2fs/node.c
diff options
context:
space:
mode:
authorChangman Lee2013-02-20 07:47:06 +0900
committerJaegeuk Kim2013-03-18 21:00:34 +0900
commit52c2db3f95ff8e8d9650885d6d66b8258ded1e38 (patch)
tree7ef8f09a14dc9495a267adb3a3dad89bd4584ae0 /fs/f2fs/node.c
parent266e97a81cf73d1a0dac5f68391da382630a80b7 (diff)
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>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r--fs/f2fs/node.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 65ec2eabb392..d408e69294c8 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -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;