return mid;
 }
 
+static void
+cifs_noop_callback(struct mid_q_entry *mid)
+{
+}
+
 int
 compound_send_recv(const unsigned int xid, struct cifs_ses *ses,
                   const int flags, const int num_rqst, struct smb_rqst *rqst,
                }
 
                midQ[i]->mid_state = MID_REQUEST_SUBMITTED;
+               /*
+                * We don't invoke the callback compounds unless it is the last
+                * request.
+                */
+               if (i < num_rqst - 1)
+                       midQ[i]->callback = cifs_noop_callback;
        }
-
        cifs_in_send_inc(ses->server);
        rc = smb_send_rqst(ses->server, num_rqst, rqst, flags);
        cifs_in_send_dec(ses->server);
                        midQ[i]->resp_buf = NULL;
        }
 out:
+       /*
+        * This will dequeue all mids. After this it is important that the
+        * demultiplex_thread will not process any of these mids any futher.
+        * This is prevented above by using a noop callback that will not
+        * wake this thread except for the very last PDU.
+        */
        for (i = 0; i < num_rqst; i++)
                cifs_delete_mid(midQ[i]);
        add_credits(ses->server, credits, optype);