win-pvdrivers

changeset 1082:8744ec2a3049 1.0.1082

Fix race where storport dpc could be called before it was initialised
author James Harper <james.harper@bendigoit.com.au>
date Thu Dec 12 10:50:27 2013 +1100 (2013-12-12)
parents 04fc4aca982c
children 82f54c86cce4
files xenvbd_storport/xenvbd.c
line diff
     1.1 --- a/xenvbd_storport/xenvbd.c	Mon Dec 09 13:35:19 2013 +1100
     1.2 +++ b/xenvbd_storport/xenvbd.c	Thu Dec 12 10:50:27 2013 +1100
     1.3 @@ -141,6 +141,9 @@ XenVbd_VirtualHwStorFindAdapter(PVOID De
     1.4    FUNCTION_MSG("aligned_buffer_data = %p\n", xvdd->aligned_buffer_data);
     1.5    FUNCTION_MSG("aligned_buffer = %p\n", xvdd->aligned_buffer);
     1.6  
     1.7 +  StorPortInitializeDpc(DeviceExtension, &xvdd->dpc, XenVbd_HandleEventDpc);
     1.8 +  xvdd->grant_tag = (ULONG)'XVBD';
     1.9 +
    1.10    /* save hypercall_stubs for crash dump */
    1.11    xvdd->hypercall_stubs = XnGetHypercallStubs();
    1.12  
    1.13 @@ -205,6 +208,7 @@ XenVbd_HwStorFindAdapter(PVOID DeviceExt
    1.14    /* align the buffer to PAGE_SIZE */
    1.15    xvdd->aligned_buffer = (PVOID)((ULONG_PTR)((PUCHAR)xvdd->aligned_buffer_data + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1));
    1.16    xvdd->aligned_buffer_size = DUMP_MODE_UNALIGNED_PAGES * PAGE_SIZE;
    1.17 +  xvdd->grant_tag = (ULONG)'DUMP';
    1.18    FUNCTION_MSG("aligned_buffer_data = %p\n", xvdd->aligned_buffer_data);
    1.19    FUNCTION_MSG("aligned_buffer = %p\n", xvdd->aligned_buffer);
    1.20  
    1.21 @@ -258,12 +262,6 @@ XenVbd_HwStorInitialize(PVOID DeviceExte
    1.22      put_shadow_on_freelist(xvdd, &xvdd->shadows[i]);
    1.23    }
    1.24  
    1.25 -  if (!dump_mode) {
    1.26 -    StorPortInitializeDpc(DeviceExtension, &xvdd->dpc, XenVbd_HandleEventDpc);
    1.27 -  } else {
    1.28 -    xvdd->grant_tag = (ULONG)'DUMP';
    1.29 -  }
    1.30 -  
    1.31    FUNCTION_EXIT();
    1.32  
    1.33    return TRUE;