Commit 1973adcb authored by Shen Feng's avatar Shen Feng Committed by Theodore Ts'o

ext4: Make ext4_ext_find_extent fills ext_path completely

When pos=0 or depth, the fields of ext4_ext_path is are not
completely filled.  This patch also removes some unnecessary code.
Signed-off-by: default avatarShen Feng <shen@cn.fujitsu.com>
Signed-off-by: default avatarMingming Cao <cmm@us.ibm.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 787e0981
...@@ -524,6 +524,7 @@ ext4_ext_find_extent(struct inode *inode, ext4_lblk_t block, ...@@ -524,6 +524,7 @@ ext4_ext_find_extent(struct inode *inode, ext4_lblk_t block,
alloc = 1; alloc = 1;
} }
path[0].p_hdr = eh; path[0].p_hdr = eh;
path[0].p_bh = NULL;
i = depth; i = depth;
/* walk through the tree */ /* walk through the tree */
...@@ -552,12 +553,14 @@ ext4_ext_find_extent(struct inode *inode, ext4_lblk_t block, ...@@ -552,12 +553,14 @@ ext4_ext_find_extent(struct inode *inode, ext4_lblk_t block,
} }
path[ppos].p_depth = i; path[ppos].p_depth = i;
path[ppos].p_hdr = eh;
path[ppos].p_ext = NULL; path[ppos].p_ext = NULL;
path[ppos].p_idx = NULL; path[ppos].p_idx = NULL;
/* find extent */ /* find extent */
ext4_ext_binsearch(inode, path + ppos, block); ext4_ext_binsearch(inode, path + ppos, block);
/* if not an empty leaf */
if (path[ppos].p_ext)
path[ppos].p_block = ext_pblock(path[ppos].p_ext);
ext4_ext_show_path(inode, path); ext4_ext_show_path(inode, path);
......
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