Index: linux-2.6.27.21-0.1/fs/ext4/extents.c =================================================================== --- linux-2.6.27.21-0.1.orig/fs/ext4/extents.c +++ linux-2.6.27.21-0.1/fs/ext4/extents.c @@ -1119,7 +1119,8 @@ ext4_ext_search_right(struct inode *inod 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; @@ -1176,7 +1177,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; }