Whamcloud - gitweb
LU-3484 llite: Anonymous dentry incorrectly identified as root 26/6726/5
authorPatrick Farrell <paf@cray.com>
Tue, 25 Jun 2013 15:56:10 +0000 (10:56 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 10 Jul 2013 02:58:48 +0000 (02:58 +0000)
When exporting Lustre via NFS on SLES11SP2, this check incorrectly identifies
anonymous dentries as root dentries.  This is due to a change in SLES11SP2
which makes the d_name.name for anonymous dentries the same as that for root
dentries.  (Details in LU-3484.)

This changes the check to directly compare the value of the dentry pointer
to the root dentry pointer found in the superblock, rather than using the name.

Signed-off-by: Patrick Farrell <paf@cray.com>
Change-Id: I18a60a7610b02d1b0580f9a0af4aeb81b5cca9b1
Reviewed-on: http://review.whamcloud.com/6726
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Peng Tao <bergwolf@gmail.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Alexey Shvetsov <alexxy@gentoo.org>
lustre/llite/dcache.c

index 029e621..0152192 100644 (file)
@@ -322,10 +322,11 @@ void ll_invalidate_aliases(struct inode *inode)
                       dentry->d_name.name, dentry, dentry->d_parent,
                       dentry->d_inode, dentry->d_flags);
 
                       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);
                 }
 
                         libcfs_debug_dumpstack(NULL);
                 }