Whamcloud - gitweb
LU-7117 osp: set ptlrpc_request::rq_allow_replay properly
[fs/lustre-release.git] / lustre / osp / osp_trans.c
index ccc8d52..c9c15c0 100644 (file)
@@ -484,10 +484,7 @@ int osp_remote_sync(const struct lu_env *env, struct osp_device *osp,
        if (rc != 0)
                RETURN(rc);
 
-       /* This will only be called with read-only update, and these updates
-        * might be used to retrieve update log during recovery process, so
-        * it will be allowed to send during recovery process */
-       req->rq_allow_replay = 1;
+       osp_set_req_replay(osp, req);
        req->rq_allow_intr = 1;
 
        /* Note: some dt index api might return non-zero result here, like
@@ -1117,7 +1114,6 @@ static int osp_send_update_req(const struct lu_env *env,
 {
        struct osp_update_args  *args;
        struct ptlrpc_request   *req;
-       struct lu_device *top_device;
        struct osp_thandle      *oth = our->our_th;
        int     rc = 0;
        ENTRY;
@@ -1174,9 +1170,7 @@ static int osp_send_update_req(const struct lu_env *env,
                 * status, in case the other target is being recoveried
                 * at the same time, and if we wait here for the import
                 * to be recoveryed, it might cause deadlock */
-               top_device = osp->opd_dt_dev.dd_lu_dev.ld_site->ls_top_dev;
-               if (top_device->ld_obd->obd_recovering)
-                       req->rq_allow_replay = 1;
+               osp_set_req_replay(osp, req);
 
                /* Because this req will be synchronus, i.e. it will be called
                 * in the same thread, so it will be safe to use current