summaryrefslogtreecommitdiffstats
path: root/fs/ext4/extents.c
diff options
context:
space:
mode:
authorShen Feng2008-07-12 01:27:31 +0200
committerTheodore Ts'o2008-07-12 01:27:31 +0200
commit1973adcba570c226de840299056e055a3614185e (patch)
tree393b70bd62ed89eb0c558312e1153ae133f44bde /fs/ext4/extents.c
parentext4: return error when calling ext4_ext_split failed (diff)
downloadkernel-qcow2-linux-1973adcba570c226de840299056e055a3614185e.tar.gz
kernel-qcow2-linux-1973adcba570c226de840299056e055a3614185e.tar.xz
kernel-qcow2-linux-1973adcba570c226de840299056e055a3614185e.zip
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: Shen Feng <shen@cn.fujitsu.com> Signed-off-by: Mingming Cao <cmm@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r--fs/ext4/extents.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index bc17ed742845..3e966daaadee 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -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 */
@@ -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);