]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ext4/extents.c
Merge branch 'devel' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa...
[linux-2.6-omap-h63xx.git] / fs / ext4 / extents.c
index e2eab196875ff694d3614b35e091e94bc82e31ea..e0aa4fe4f596fcb11549de818436edced6887f3b 100644 (file)
@@ -1122,7 +1122,8 @@ ext4_ext_search_right(struct inode *inode, struct ext4_ext_path *path,
        struct ext4_extent_idx *ix;
        struct ext4_extent *ex;
        ext4_fsblk_t block;
-       int depth, ee_len;
+       int depth;      /* Note, NOT eh_depth; depth from top of tree */
+       int ee_len;
 
        BUG_ON(path == NULL);
        depth = path->p_depth;
@@ -1179,7 +1180,8 @@ got_index:
                if (bh == NULL)
                        return -EIO;
                eh = ext_block_hdr(bh);
-               if (ext4_ext_check_header(inode, eh, depth)) {
+               /* subtract from p_depth to get proper eh_depth */
+               if (ext4_ext_check_header(inode, eh, path->p_depth - depth)) {
                        put_bh(bh);
                        return -EIO;
                }