Skip to content

Commit

Permalink
ext4: Make ext4_ext_find_extent fills ext_path completely
Browse files Browse the repository at this point in the history
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: Shen Feng <shen@cn.fujitsu.com>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
Shen Feng authored and Theodore Ts'o committed Jul 11, 2008
1 parent 787e098 commit 1973adc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/ext4/extents.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ ext4_ext_find_extent(struct inode *inode, ext4_lblk_t block,
alloc = 1;
}
path[0].p_hdr = eh;
path[0].p_bh = NULL;

i = depth;
/* walk through the tree */
Expand Down Expand Up @@ -552,12 +553,14 @@ ext4_ext_find_extent(struct inode *inode, ext4_lblk_t block,
}

path[ppos].p_depth = i;
path[ppos].p_hdr = eh;
path[ppos].p_ext = NULL;
path[ppos].p_idx = NULL;

/* find extent */
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);

Expand Down

0 comments on commit 1973adc

Please sign in to comment.