Whamcloud - gitweb
LU-4413 osp: move seq allocation out of osp_import_event 97/8997/3
authorwang di <di.wang@intel.com>
Fri, 24 Jan 2014 22:21:07 +0000 (14:21 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 27 Jan 2014 18:11:23 +0000 (18:11 +0000)
Because seq allocation(osp_init_pre_fid) might be stuck
during RPC, move it out of osp_import_event, which is
inside ptlrpcd_rcv. Otherwise, some other import RPCs(like
connect req)might be blocked in ptlrpcd_rcv.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: Ib4014f8b0088ea3613fa4d53d3e274f5bdfe70c7
Reviewed-on: http://review.whamcloud.com/8997
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osp/osp_dev.c
lustre/osp/osp_precreate.c

index d246678..819338b 100644 (file)
@@ -863,8 +863,6 @@ static int osp_reconnect(const struct lu_env *env,
 
 static int osp_prepare_fid_client(struct osp_device *osp)
 {
-       int rc;
-
        LASSERT(osp->opd_obd->u.cli.cl_seq != NULL);
        if (osp->opd_obd->u.cli.cl_seq->lcs_exp != NULL)
                return 0;
@@ -872,19 +870,6 @@ static int osp_prepare_fid_client(struct osp_device *osp)
        LASSERT(osp->opd_exp != NULL);
        osp->opd_obd->u.cli.cl_seq->lcs_exp =
                                class_export_get(osp->opd_exp);
-       if (osp->opd_pre == NULL)
-               return 0;
-
-       /* Init fid for osp_precreate if necessary */
-       rc = osp_init_pre_fid(osp);
-       if (rc != 0) {
-               class_export_put(osp->opd_exp);
-               osp->opd_obd->u.cli.cl_seq->lcs_exp = NULL;
-               CERROR("%s: init pre fid error: rc = %d\n",
-                      osp->opd_obd->obd_name, rc);
-               return rc;
-       }
-
        return 0;
 }
 
index 6b1db95..22a1060 100644 (file)
@@ -916,6 +916,16 @@ static int osp_precreate_thread(void *_arg)
                if (d->opd_obd->u.cli.cl_seq->lcs_exp == NULL)
                        continue;
 
+               /* Init fid for osp_precreate if necessary */
+               rc = osp_init_pre_fid(d);
+               if (rc != 0) {
+                       class_export_put(d->opd_exp);
+                       d->opd_obd->u.cli.cl_seq->lcs_exp = NULL;
+                       CERROR("%s: init pre fid error: rc = %d\n",
+                              d->opd_obd->obd_name, rc);
+                       continue;
+               }
+
                osp_statfs_update(d);
 
                /*