Whamcloud - gitweb
LU-4423 llite: get rid of lustre_dump_dentry() 39/25639/4
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 9 Mar 2017 18:11:35 +0000 (13:11 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 23 Mar 2017 01:41:51 +0000 (01:41 +0000)
it's not only badly racy, it's actually dead code - the call in
ll_invalidate_aliases() is unreachable.  For an alias of our inode
to be root dentry, the inode would have to be its ->d_inode, aka
the root inode, and we never call ll_invalidate_aliases() for that.

Linux-commit: 5e9e2040247ac19a46d6627736ece726c46f1fdf

Change-Id: Ic5e475102793424396bb8b173eb8d9a3b020bd82
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/25639
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/dcache.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c

index 0c0ee69..b9c3589 100644 (file)
@@ -248,14 +248,6 @@ void ll_invalidate_aliases(struct inode *inode)
                       dentry->d_name.name, dentry, dentry->d_parent,
                       dentry->d_inode, dentry->d_flags);
 
-               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, 0);
        }
        ll_unlock_dcache(inode);
index 506ca46..0243cc5 100644 (file)
@@ -881,7 +881,6 @@ int ll_show_options(struct seq_file *seq, struct vfsmount *vfs);
 void ll_dirty_page_discard_warn(struct page *page, int ioret);
 int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
                  struct super_block *, struct lookup_intent *);
-void lustre_dump_dentry(struct dentry *, int recur);
 int ll_obd_statfs(struct inode *inode, void __user *arg);
 int ll_get_max_mdsize(struct ll_sb_info *sbi, int *max_mdsize);
 int ll_get_default_mdsize(struct ll_sb_info *sbi, int *default_mdsize);
index 88505aa..fe9bcdc 100644 (file)
@@ -678,51 +678,6 @@ int ll_set_default_mdsize(struct ll_sb_info *sbi, int lmmsize)
        RETURN(rc);
 }
 
-static void ll_dump_inode(struct inode *inode)
-{
-       struct ll_d_hlist_node *tmp;
-       int dentry_count = 0;
-
-       LASSERT(inode != NULL);
-
-       ll_d_hlist_for_each(tmp, &inode->i_dentry)
-               dentry_count++;
-
-       CERROR("%s: inode %p dump: dev=%s fid="DFID
-              " mode=%o count=%u, %d dentries\n",
-              ll_get_fsname(inode->i_sb, NULL, 0), inode,
-              ll_i2mdexp(inode)->exp_obd->obd_name, PFID(ll_inode2fid(inode)),
-              inode->i_mode, atomic_read(&inode->i_count), dentry_count);
-}
-
-void lustre_dump_dentry(struct dentry *dentry, int recur)
-{
-        struct list_head *tmp;
-        int subdirs = 0;
-
-        LASSERT(dentry != NULL);
-
-        list_for_each(tmp, &dentry->d_subdirs)
-                subdirs++;
-
-        CERROR("dentry %p dump: name=%.*s parent=%.*s (%p), inode=%p, count=%u,"
-               " flags=0x%x, fsdata=%p, %d subdirs\n", dentry,
-               dentry->d_name.len, dentry->d_name.name,
-               dentry->d_parent->d_name.len, dentry->d_parent->d_name.name,
-              dentry->d_parent, dentry->d_inode, ll_d_count(dentry),
-               dentry->d_flags, dentry->d_fsdata, subdirs);
-        if (dentry->d_inode != NULL)
-                ll_dump_inode(dentry->d_inode);
-
-        if (recur == 0)
-                return;
-
-       list_for_each(tmp, &dentry->d_subdirs) {
-               struct dentry *d = list_entry(tmp, struct dentry, d_child);
-               lustre_dump_dentry(d, recur - 1);
-       }
-}
-
 static void client_common_put_super(struct super_block *sb)
 {
         struct ll_sb_info *sbi = ll_s2sbi(sb);