From 90a1b772d26c86c8c08317bc594372500273cb0d Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Tue, 25 Jun 2013 10:56:10 -0500 Subject: [PATCH] LU-3484 llite: Anonymous dentry incorrectly identified as root 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 Change-Id: I18a60a7610b02d1b0580f9a0af4aeb81b5cca9b1 Reviewed-on: http://review.whamcloud.com/6726 Reviewed-by: Bob Glossman Tested-by: Hudson Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Peng Tao Reviewed-by: James Simmons Reviewed-by: Alexey Shvetsov --- lustre/llite/dcache.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lustre/llite/dcache.c b/lustre/llite/dcache.c index 029e621..0152192 100644 --- a/lustre/llite/dcache.c +++ b/lustre/llite/dcache.c @@ -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); - 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); } -- 1.8.3.1