staging/lustre/llite: Anonymous dentry incorrectly identified as root
authorPatrick Farrell <paf@cray.com>
Mon, 22 Jul 2013 16:07:03 +0000 (00:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jul 2013 20:45:08 +0000 (13:45 -0700)
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.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3484
Lustre-change: http://review.whamcloud.com/6726
Signed-off-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.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>
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/dcache.c

index a160a840d5829a9ee94a2b6c7a37695488d07816..0d49e1bfb6bbfcf315581506eeea1d4febf0a011 100644 (file)
@@ -295,9 +295,10 @@ 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);
+               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);
                        dump_stack();
                }
This page took 0.045302 seconds and 5 git commands to generate.