Ticket #10222: 0001-usb_disk-update_capacity-now-retries-until-success.patch

File 0001-usb_disk-update_capacity-now-retries-until-success.patch, 1.4 KB (added by korli, 10 years ago)

patch

  • src/add-ons/kernel/drivers/disk/usb/usb_disk/usb_disk.cpp

    From c2149b78bea649febb4a9ff2f1229bc7a863841c Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
    Date: Tue, 19 Nov 2013 20:42:45 +0100
    Subject: [PATCH] usb_disk: update_capacity() now retries until success.
    
    ---
     src/add-ons/kernel/drivers/disk/usb/usb_disk/usb_disk.cpp | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/src/add-ons/kernel/drivers/disk/usb/usb_disk/usb_disk.cpp b/src/add-ons/kernel/drivers/disk/usb/usb_disk/usb_disk.cpp
    index 5da2965..5c937f1 100644
    a b usb_disk_update_capacity(device_lun *lun)  
    607607    // Retry reading the capacity up to three times. The first try might only
    608608    // yield a unit attention telling us that the device or media status
    609609    // changed, which is more or less expected if it is the first operation
    610     // on the device or the device only clears the unit atention for capacity
     610    // on the device or the device only clears the unit attention for capacity
    611611    // reads.
    612612    for (int32 i = 0; i < 3; i++) {
    613613        result = usb_disk_operation(lun, SCSI_READ_CAPACITY_10, 10, 0, 0,
    614614            &parameter, &dataLength, true, &action);
    615         if (result == B_OK || (action != err_act_retry
    616                 && action != err_act_many_retries)) {
     615        if (result == B_OK && action != err_act_retry
     616                && action != err_act_many_retries) {
    617617            break;
    618618        }
    619619    }