1 Index: linux-2.6.18.i386/fs/ext4/namei.c
2 ===================================================================
3 --- linux-2.6.18.i386.orig/fs/ext4/namei.c
4 +++ linux-2.6.18.i386/fs/ext4/namei.c
5 @@ -1067,6 +1067,38 @@ static struct dentry *ext4_lookup(struct
9 + /* ".." shouldn't go into dcache to preserve dcache hierarchy
10 + * otherwise we'll get parent being a child of actual child.
11 + * see bug 10458 for details -bzzz */
12 + if (inode && (dentry->d_name.name[0] == '.' && (dentry->d_name.len == 1 ||
13 + (dentry->d_name.len == 2 && dentry->d_name.name[1] == '.')))) {
14 + struct dentry *tmp, *goal = NULL;
15 + struct list_head *lp;
17 + /* first, look for an existing dentry - any one is good */
18 + spin_lock(&dcache_lock);
19 + list_for_each(lp, &inode->i_dentry) {
20 + tmp = list_entry(lp, struct dentry, d_alias);
26 + /* there is no alias, we need to make current dentry:
27 + * a) inaccessible for __d_lookup()
28 + * b) inaccessible for iopen */
29 + J_ASSERT(list_empty(&dentry->d_alias));
30 + dentry->d_flags |= DCACHE_NFSFS_RENAMED;
31 + /* this is d_instantiate() ... */
32 + list_add(&dentry->d_alias, &inode->i_dentry);
33 + dentry->d_inode = inode;
35 + spin_unlock(&dcache_lock);
41 return d_splice_alias(inode, dentry);