Whamcloud - gitweb
LU-2845 osp: fix osp precreate thread init error handling
authorBobi Jam <bobijam.xu@intel.com>
Fri, 22 Feb 2013 03:08:00 +0000 (11:08 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 20 Mar 2013 21:25:02 +0000 (17:25 -0400)
If osp device hasn't connected OST, osp_precreate_thread() should
heed to that and bypass the normal quitting path.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Change-Id: I27d18dfd4d7d55c97eeb169b5d7dc7042a42fd33
Reviewed-on: http://review.whamcloud.com/5508
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osp/osp_dev.c
lustre/osp/osp_precreate.c

index f8c6fef..af6ef02 100644 (file)
@@ -695,6 +695,14 @@ static int osp_init0(const struct lu_env *env, struct osp_device *m,
                rc = osp_last_used_init(env, m);
                if (rc)
                        GOTO(out_proc, rc);
+
+               rc = obd_fid_init(m->opd_obd, NULL, LUSTRE_SEQ_DATA);
+               if (rc) {
+                       CERROR("%s: fid init error: rc = %d\n",
+                              m->opd_obd->obd_name, rc);
+                       GOTO(out_last_used, rc);
+               }
+
                /* Initialize precreation thread, it handles new
                 * connections as well. */
                rc = osp_init_precreate(m);
@@ -709,12 +717,6 @@ static int osp_init0(const struct lu_env *env, struct osp_device *m,
                if (rc)
                        GOTO(out_precreat, rc);
 
-               rc = obd_fid_init(m->opd_obd, NULL, LUSTRE_SEQ_DATA);
-               if (rc) {
-                       CERROR("%s: fid init error: rc = %d\n",
-                              m->opd_obd->obd_name, rc);
-                       GOTO(out, rc);
-               }
        }
        /*
         * Initiate connect to OST
index 405524c..1836f18 100644 (file)
@@ -912,9 +912,6 @@ static int osp_precreate_thread(void *_arg)
                                     d->opd_new_connection,
                                     &lwi);
 
-                       if (!osp_precreate_running(d))
-                               break;
-
                        if (!d->opd_new_connection)
                                continue;
 
@@ -923,6 +920,10 @@ static int osp_precreate_thread(void *_arg)
                        break;
                }
 
+               if (!osp_precreate_running(d))
+                       break;
+
+               LASSERT(d->opd_obd->u.cli.cl_seq != NULL);
                if (d->opd_obd->u.cli.cl_seq->lcs_exp == NULL) {
                        /* Get new sequence for client first */
                        LASSERT(d->opd_exp != NULL);