Whamcloud - gitweb
LU-3484 llite: Anonymous dentry incorrectly identified as root
[fs/lustre-release.git] / lustre / llite / dcache.c
index 1a8d156..0152192 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2012, Intel Corporation.
+ * Copyright (c) 2011, 2013, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -191,7 +191,8 @@ static int ll_ddelete(HAVE_D_DELETE_CONST struct dentry *de)
 
        /* Disable this piece of code temproarily because this is called
         * inside dcache_lock so it's not appropriate to do lots of work
-        * here. */
+        * here. ATTENTION: Before this piece of code enabling, LU-2487 must be
+        * resolved. */
 #if 0
        /* if not ldlm lock for this inode, set i_nlink to 0 so that
         * this inode can be recycled later b=20433 */
@@ -321,14 +322,15 @@ void ll_invalidate_aliases(struct inode *inode)
                       dentry->d_name.name, dentry, dentry->d_parent,
                       dentry->d_inode, dentry->d_flags);
 
-                if (dentry->d_name.len == 1 && dentry->d_name.name[0] == '/') {
-                        CERROR("called on root (?) dentry=%p, inode=%p "
-                               "ino=%lu\n", dentry, inode, inode->i_ino);
-                        lustre_dump_dentry(dentry, 1);
+               if (unlikely(dentry == dentry->d_sb->s_root)) {
+                       CERROR("%s: called on root dentry=%p, fid="DFID"\n",
+                              ll_get_fsname(dentry->d_sb, NULL, 0),
+                              dentry, PFID(ll_inode2fid(inode)));
+                       lustre_dump_dentry(dentry, 1);
                         libcfs_debug_dumpstack(NULL);
                 }
 
-               d_lustre_invalidate(dentry);
+               d_lustre_invalidate(dentry, 0);
        }
        ll_unlock_dcache(inode);