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,
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 {