[IBAL] This patch cancels all outstanding UAL_CEP_GET_REQ_CID IRPs queued in a CEP...
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 1 Jul 2008 18:19:33 +0000 (18:19 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 1 Jul 2008 18:19:33 +0000 (18:19 +0000)
Signed-off-by: Fab Tillier <ftillier@microsoft.com>
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1316 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/al/kernel/al_cm_cep.c

index e603abf..29041d4 100644 (file)
@@ -4155,6 +4155,25 @@ al_destroy_cep(
        /* Cancel any queued IRP */\r
        __cep_complete_irp( p_cep, STATUS_CANCELLED, IO_NO_INCREMENT );\r
 \r
+    while( !IsListEmpty( &p_cep->irp_que ) )\r
+    {\r
+        LIST_ENTRY* p_list_entry;\r
+        IRP* p_irp;\r
+\r
+        // get IRP\r
+        p_list_entry = RemoveHeadList( &p_cep->irp_que );\r
+        p_irp = (PIRP)CONTAINING_RECORD( p_list_entry, IRP, Tail.Overlay.ListEntry );\r
+\r
+        // complete GetConnectionReq IRP\r
+#pragma warning(push, 3)\r
+        IoSetCancelRoutine( p_irp, NULL );\r
+#pragma warning(pop)\r
+\r
+        p_irp->IoStatus.Information = 0;\r
+        p_irp->IoStatus.Status = STATUS_CANCELLED;\r
+        IoCompleteRequest( p_irp, IO_NETWORK_INCREMENT );\r
+    }\r
+\r
        __unbind_cep( p_cep );\r
        ref_cnt = __cleanup_cep( p_cep );\r
        KeReleaseInStackQueuedSpinLock( &hdl );\r