Whamcloud - gitweb
b=22342 more sanity check for same dentry.
authorFan Yong <Yong.Fan@Sun.COM>
Tue, 23 Mar 2010 18:36:59 +0000 (11:36 -0700)
committerRobert Read <rread@sun.com>
Tue, 23 Mar 2010 18:36:59 +0000 (11:36 -0700)
More sanity check for same dentry.

i=robert.read
i=eric.mei

lustre/llite/namei.c
lustre/llite/statahead.c

index 3106c36..9eecc1f 100644 (file)
@@ -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);
index bd76343..503235a 100644 (file)
@@ -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;