Whamcloud - gitweb
LU-2895 osp: return proper error in osp_precreate_reserve
[fs/lustre-release.git] / lustre / osp / osp_precreate.c
index 405524c..9b3febc 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);
@@ -1138,8 +1139,10 @@ int osp_precreate_reserve(const struct lu_env *env, struct osp_device *d)
 
                lwi = LWI_TIMEOUT(expire - cfs_time_current(),
                                osp_precreate_timeout_condition, d);
-               if (cfs_time_aftereq(cfs_time_current(), expire))
+               if (cfs_time_aftereq(cfs_time_current(), expire)) {
+                       rc = -ETIMEDOUT;
                        break;
+               }
 
                l_wait_event(d->opd_pre_user_waitq,
                             osp_precreate_ready_condition(env, d), &lwi);