Whamcloud - gitweb
LU-3230 osp: unstick precreates on unmount
[fs/lustre-release.git] / lustre / osp / osp_precreate.c
index 7f68596..4bd43d3 100644 (file)
@@ -539,24 +539,22 @@ static int osp_get_lastfid_from_ost(const struct lu_env *env,
        if (req == NULL)
                RETURN(-ENOMEM);
 
-       req_capsule_set_size(&req->rq_pill, &RMF_SETINFO_KEY, RCL_CLIENT,
+       req_capsule_set_size(&req->rq_pill, &RMF_GETINFO_KEY, RCL_CLIENT,
                             sizeof(KEY_LAST_FID));
 
-       req_capsule_set_size(&req->rq_pill, &RMF_SETINFO_VAL, RCL_CLIENT,
-                            sizeof(struct lu_fid));
-
        rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, OST_GET_INFO);
        if (rc) {
                ptlrpc_request_free(req);
                RETURN(rc);
        }
 
-       tmp = req_capsule_client_get(&req->rq_pill, &RMF_SETINFO_KEY);
+       tmp = req_capsule_client_get(&req->rq_pill, &RMF_GETINFO_KEY);
        memcpy(tmp, KEY_LAST_FID, sizeof(KEY_LAST_FID));
 
        req->rq_no_delay = req->rq_no_resend = 1;
-       tmp = req_capsule_client_get(&req->rq_pill, &RMF_SETINFO_VAL);
-       fid_cpu_to_le((struct lu_fid *)tmp, &d->opd_last_used_fid);
+       last_fid = req_capsule_client_get(&req->rq_pill, &RMF_FID);
+       fid_cpu_to_le(last_fid, &d->opd_last_used_fid);
+
        ptlrpc_request_set_replen(req);
 
        rc = ptlrpc_queue_wait(req);
@@ -1012,8 +1010,16 @@ static int osp_precreate_ready_condition(const struct lu_env *env,
                return 1;
 
        /* Bail out I/O fails to OST */
-       if (d->opd_pre_status == -EIO)
+       if (d->opd_pre_status != 0 &&
+           d->opd_pre_status != -EAGAIN &&
+           d->opd_pre_status != -ENODEV &&
+           d->opd_pre_status != -ENOSPC) {
+               /* DEBUG LU-3230 */
+               if (d->opd_pre_status != -EIO)
+                       CERROR("%s: precreate failed opd_pre_status %d\n",
+                              d->opd_obd->obd_name, d->opd_pre_status);
                return 1;
+       }
 
        return 0;
 }
@@ -1240,7 +1246,7 @@ out:
 int osp_init_precreate(struct osp_device *d)
 {
        struct l_wait_info       lwi = { 0 };
-       cfs_task_t              *task;
+       struct task_struct              *task;
 
        ENTRY;