Whamcloud - gitweb
LU-14393 recovery: reply reconstruction for batched RPCs
[fs/lustre-release.git] / lustre / ptlrpc / batch.c
index 32a8987..18b8796 100644 (file)
@@ -375,6 +375,7 @@ static int batch_update_interpret(const struct lu_env *env,
        if (aa->ba_head == NULL)
                RETURN(0);
 
+       ptlrpc_put_mod_rpc_slot(req);
        /* Unpack the results from the reply message. */
        if (req->rq_repmsg != NULL && req->rq_replied) {
                reply = req_capsule_server_sized_get(&req->rq_pill,
@@ -414,6 +415,13 @@ static int batch_send_update_req(const struct lu_env *env,
        aa->ba_head = head;
        req->rq_interpret_reply = batch_update_interpret;
 
+       /*
+        * Only acquire modification RPC slot for the batched RPC
+        * which contains metadata updates.
+        */
+       if (!(bh->lbt_flags & BATCH_FL_RDONLY))
+               ptlrpc_get_mod_rpc_slot(req);
+
        if (bh->lbt_flags & BATCH_FL_SYNC) {
                rc = ptlrpc_queue_wait(req);
        } else {