staging: lustre: lmv: remove nlink check in lmv_revalidate_slaves
authorwang di <di.wang@intel.com>
Sun, 29 Jan 2017 00:05:25 +0000 (19:05 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Feb 2017 12:01:38 +0000 (13:01 +0100)
If an application attempts to remove millions of files in a
single directory it will fail. This failure was tracked down to
the nlink < 2 check in lmv_revalidate_slaves, because after
nlink reaches to maximum value of LDISKFS_LINK_MAX (65000),
the nlink broadcast back from the server will be reported as
one. The return value of 1 is not invalid so lets remove
the check.

Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6984
Reviewed-on: http://review.whamcloud.com/16490
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/lmv/lmv_intent.c

index b1071cf5a70c7323e7207e6c0252a2b4d3cbf629..aa42066678e0dec285492965e41a21327170b832 100644 (file)
@@ -220,21 +220,7 @@ int lmv_revalidate_slaves(struct obd_export *exp,
                        /* refresh slave from server */
                        body = req_capsule_server_get(&req->rq_pill,
                                                      &RMF_MDT_BODY);
-                       LASSERT(body);
-
-                       if (unlikely(body->mbo_nlink < 2)) {
-                               /*
-                                * If this is bad stripe, most likely due
-                                * to the race between close(unlink) and
-                                * getattr, let's return -EONENT, so llite
-                                * will revalidate the dentry see
-                                * ll_inode_revalidate_fini()
-                                */
-                               CDEBUG(D_INODE, "%s: nlink %d < 2 corrupt stripe %d "DFID":" DFID"\n",
-                                      obd->obd_name, body->mbo_nlink, i,
-                                      PFID(&lsm->lsm_md_oinfo[i].lmo_fid),
-                                      PFID(&lsm->lsm_md_oinfo[0].lmo_fid));
-
+                       if (!body) {
                                if (it.it_lock_mode && lockh) {
                                        ldlm_lock_decref(lockh, it.it_lock_mode);
                                        it.it_lock_mode = 0;