Whamcloud - gitweb
b=19674
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ext3-check-bad-inode.patch
1 Index: linux-2.6.22/fs/ext3/namei.c
2 ===================================================================
3 --- linux-2.6.22.orig/fs/ext3/namei.c   2007-11-15 13:41:18.000000000 +0100
4 +++ linux-2.6.22/fs/ext3/namei.c        2007-11-15 13:44:28.000000000 +0100
5 @@ -1019,6 +1019,11 @@ static struct dentry *ext3_lookup(struct
6  
7                 if (!inode)
8                         return ERR_PTR(-EACCES);
9 +
10 +               if (is_bad_inode(inode)) {
11 +                       iput(inode);
12 +                       return ERR_PTR(-ENOENT);
13 +               }
14         }
15         return d_splice_alias(inode, dentry);
16  }
17 @@ -1054,6 +1059,11 @@ struct dentry *ext3_get_parent(struct de
18         if (!inode)
19                 return ERR_PTR(-EACCES);
20  
21 +       if (is_bad_inode(inode)) {
22 +               iput(inode);
23 +               return ERR_PTR(-ENOENT);
24 +       }
25 +
26         parent = d_alloc_anon(inode);
27         if (!parent) {
28                 iput(inode);