From: Fan Yong Date: Tue, 23 Mar 2010 18:36:59 +0000 (-0700) Subject: b=22342 more sanity check for same dentry. X-Git-Tag: 1.10.0.39~35 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=cc580d67ee72fce637374891714885c889dce026;hp=64218d0b47731c039234b16b8343d8ee3b407281 b=22342 more sanity check for same dentry. More sanity check for same dentry. i=robert.read i=eric.mei --- diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index 3106c36..9eecc1f 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -411,7 +411,9 @@ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *de) iput(inode); return last_discon; } + lock_dentry(de); de->d_flags |= DCACHE_LUSTRE_INVALID; + unlock_dentry(de); ll_d_add(de, inode); spin_unlock(&dcache_lock); diff --git a/lustre/llite/statahead.c b/lustre/llite/statahead.c index bd76343..503235a 100644 --- a/lustre/llite/statahead.c +++ b/lustre/llite/statahead.c @@ -1094,7 +1094,9 @@ static int is_same_dentry(struct dentry *d1, struct dentry *d2) { if (unlikely(d1 == d2)) return 1; - if (d1->d_name.len == d2->d_name.len && + if (d1->d_parent == d2->d_parent && + d1->d_name.hash == d2->d_name.hash && + d1->d_name.len == d2->d_name.len && memcmp(d1->d_name.name, d2->d_name.name, d1->d_name.len) == 0) return 1; return 0;