atomic_read(&totSmBufAllocCount));
 #endif /* CONFIG_CIFS_STATS2 */
 
-       seq_printf(m, "Operations (MIDs): %d\n", midCount.counter);
+       seq_printf(m, "Operations (MIDs): %d\n", atomic_read(&midCount));
        seq_printf(m,
                "\n%d session %d share reconnects\n",
                tcpSesReconnectCount.counter, tconInfoReconnectCount.counter);
 
                } else if (!is_valid_oplock_break(smb_buffer, server) &&
                           !isMultiRsp) {
                        cERROR(1, "No task to wake, unknown frame received! "
-                                  "NumMids %d", midCount.counter);
+                                  "NumMids %d", atomic_read(&midCount));
                        cifs_dump_mem("Received Data is: ", (char *)smb_buffer,
                                      sizeof(struct smb_hdr));
 #ifdef CONFIG_CIFS_DEBUG2
 
                temp->tsk = current;
        }
 
-       spin_lock(&GlobalMid_Lock);
-       list_add_tail(&temp->qhead, &server->pending_mid_q);
        atomic_inc(&midCount);
        temp->midState = MID_REQUEST_ALLOCATED;
+       spin_lock(&GlobalMid_Lock);
+       list_add_tail(&temp->qhead, &server->pending_mid_q);
        spin_unlock(&GlobalMid_Lock);
        return temp;
 }
        spin_lock(&GlobalMid_Lock);
        midEntry->midState = MID_FREE;
        list_del(&midEntry->qhead);
-       atomic_dec(&midCount);
        spin_unlock(&GlobalMid_Lock);
+       atomic_dec(&midCount);
        if (midEntry->largeBuf)
                cifs_buf_release(midEntry->resp_buf);
        else