Whamcloud - gitweb
f505008b4c65a270c8cec44ea08f55008171368f
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ext4_ext_search_right-fix.patch
1 Index: linux-2.6.27.21-0.1/fs/ext4/extents.c
2 ===================================================================
3 --- linux-2.6.27.21-0.1.orig/fs/ext4/extents.c
4 +++ linux-2.6.27.21-0.1/fs/ext4/extents.c
5 @@ -1119,7 +1119,8 @@ ext4_ext_search_right(struct inode *inod
6         struct ext4_extent_idx *ix;
7         struct ext4_extent *ex;
8         ext4_fsblk_t block;
9 -       int depth, ee_len;
10 +       int depth; /* Note, NOT eh_depth; depth from top of tree */
11 +       int ee_len;
12  
13         BUG_ON(path == NULL);
14         depth = path->p_depth;
15 @@ -1176,7 +1177,8 @@ got_index:
16                 if (bh == NULL)
17                         return -EIO;
18                 eh = ext_block_hdr(bh);
19 -               if (ext4_ext_check_header(inode, eh, depth)) {
20 +               /* subtract from p_depth to get proper eh_depth */
21 +               if (ext4_ext_check_header(inode, eh, path->p_depth - depth)) {
22                         put_bh(bh);
23                         return -EIO;
24                 }