X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=ldiskfs%2Fkernel_patches%2Fpatches%2Frhel7%2Fext4-lookup-dotdot.patch;fp=ldiskfs%2Fkernel_patches%2Fpatches%2Frhel7%2Fext4-lookup-dotdot.patch;h=f4318c50527e7008f944506aafd0f6bb343e3188;hb=eaf30e35002bf3936cdf7bf83685552d854f0f88;hp=0000000000000000000000000000000000000000;hpb=db47990bbf7c59474f4c5ca28f96fdf424275516;p=fs%2Flustre-release.git diff --git a/ldiskfs/kernel_patches/patches/rhel7/ext4-lookup-dotdot.patch b/ldiskfs/kernel_patches/patches/rhel7/ext4-lookup-dotdot.patch new file mode 100644 index 0000000..f4318c5 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/rhel7/ext4-lookup-dotdot.patch @@ -0,0 +1,37 @@ +Index: linux-3.10.9-200.fc17.x86_64/fs/ext4/namei.c +=================================================================== +--- linux-3.10.9-200.fc17.x86_64.orig/fs/ext4/namei.c ++++ linux-3.10.9-200.fc17.x86_64/fs/ext4/namei.c +@@ -1438,6 +1438,32 @@ static struct dentry *ext4_lookup(struct + return ERR_PTR(-EIO); + } + } ++ /* ".." shouldn't go into dcache to preserve dcache hierarchy ++ * otherwise we'll get parent being a child of actual child. ++ * see bug 10458 for details -bzzz */ ++ if (inode && (dentry->d_name.name[0] == '.' && (dentry->d_name.len == 1 || ++ (dentry->d_name.len == 2 && dentry->d_name.name[1] == '.')))) { ++ struct dentry *goal = NULL; ++ ++ /* first, look for an existing dentry - any one is good */ ++ goal = d_find_any_alias(inode); ++ if (goal == NULL) { ++ spin_lock(&dentry->d_lock); ++ /* there is no alias, we need to make current dentry: ++ * a) inaccessible for __d_lookup() ++ * b) inaccessible for iopen */ ++ J_ASSERT(hlist_unhashed(&dentry->d_alias)); ++ dentry->d_flags |= DCACHE_NFSFS_RENAMED; ++ /* this is d_instantiate() ... */ ++ hlist_add_head(&dentry->d_alias, &inode->i_dentry); ++ dentry->d_inode = inode; ++ spin_unlock(&dentry->d_lock); ++ } ++ if (goal) ++ iput(inode); ++ return goal; ++ } ++ + return d_splice_alias(inode, dentry); + } +