Whamcloud - gitweb
LU-3484 llite: Anonymous dentry incorrectly identified as root
[fs/lustre-release.git] / lustre / llite / dcache.c
index 328a687..0152192 100644 (file)
@@ -322,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);