win-pvdrivers

changeset 309:41c06d83082d wdm

Fixed a crash when running hdtune.
author James Harper <james.harper@bendigoit.com.au>
date Wed Jun 11 21:24:57 2008 +1000 (2008-06-11)
parents 094537c517f5
children 60372bd2582d
files xenvbd/scsiport.c
line diff
     1.1 --- a/xenvbd/scsiport.c	Wed Jun 11 21:04:54 2008 +1000
     1.2 +++ b/xenvbd/scsiport.c	Wed Jun 11 21:24:57 2008 +1000
     1.3 @@ -367,7 +367,7 @@ XenVbd_PutSrbOnRing(PXENVBD_DEVICE_DATA 
     1.4  
     1.5  //  KdPrint((__DRIVER_NAME " --> " __FUNCTION__ "\n"));
     1.6  
     1.7 -  ASSERT(!(srb_offset == 0 && xvdd->split_request_in_progress));
     1.8 +  //ASSERT(!(srb_offset == 0 && xvdd->split_request_in_progress));
     1.9    block_count = (srb->Cdb[7] << 8) | srb->Cdb[8];
    1.10    block_count *= xvdd->bytes_per_sector / 512;
    1.11    if (PtrToUlong(srb->DataBuffer) & 511) /* use SrbExtension intead of DataBuffer if DataBuffer is not aligned to sector size */
    1.12 @@ -394,7 +394,6 @@ XenVbd_PutSrbOnRing(PXENVBD_DEVICE_DATA 
    1.13      //KdPrint((__DRIVER_NAME "     No enough grants - deferring\n"));
    1.14      xvdd->pending_srb = srb;
    1.15      xvdd->no_free_grant_requests++;
    1.16 -
    1.17      return;
    1.18    }
    1.19    
    1.20 @@ -451,19 +450,8 @@ XenVbd_PutSrbOnRing(PXENVBD_DEVICE_DATA 
    1.21    if (notify)
    1.22      xvdd->vectors.EvtChn_Notify(xvdd->vectors.context, xvdd->event_channel);
    1.23  
    1.24 -  /* we don't want another srb if we had to double buffer this one, it will put things out of order */
    1.25 -  if (srb_offset + shadow->length == block_count * 512)
    1.26 -  {
    1.27 -    if (xvdd->shadow_free)
    1.28 -    {
    1.29 -      ScsiPortNotification(NextLuRequest, xvdd, 0, 0, 0);
    1.30 -    }
    1.31 -    xvdd->split_request_in_progress = FALSE;
    1.32 -  }
    1.33 -  else
    1.34 -  {
    1.35 -    xvdd->split_request_in_progress = TRUE;
    1.36 -  }
    1.37 +  if (xvdd->shadow_free && srb_offset == 0)
    1.38 +    ScsiPortNotification(NextLuRequest, xvdd, 0, 0, 0);
    1.39  
    1.40    //KdPrint((__DRIVER_NAME " <-- " __FUNCTION__ "\n"));
    1.41  }
    1.42 @@ -689,7 +677,7 @@ XenVbd_HwScsiInterrupt(PVOID DeviceExten
    1.43              xvdd->pending_srb = NULL;
    1.44              XenVbd_PutSrbOnRing(xvdd, srb, 0);
    1.45            }
    1.46 -          else if (!xvdd->split_request_in_progress)
    1.47 +          else
    1.48              ScsiPortNotification(NextLuRequest, DeviceExtension, 0, 0, 0);
    1.49          }
    1.50        }