Re: [PATCH 1/2] virtio_scsi: do not overwrite SCSI status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/15/21 4:59 AM, Martin K. Petersen wrote:
> 
> Hannes,
> 
>> When a sense code is present we should not override the scsi status;
>> the driver already sets it based on the response from the hypervisor.
> 
> Color me confused. The code looks like this:
> 
>         if (sc->sense_buffer) {
>                 memcpy(sc->sense_buffer, resp->sense,
>                        min_t(u32,
>                              virtio32_to_cpu(vscsi->vdev, resp->sense_len),
>                              VIRTIO_SCSI_SENSE_SIZE));
>                 set_status_byte(sc, SAM_STAT_CHECK_CONDITION);
>         }
> 
> But sc->sense_buffer is always true, the scsi_cmnd obviously has a sense
> buffer.
> 
> Shouldn't that be looking at the returned response instead?
> 
> 	if (resp->sense_len) {
>                 memcpy(sc->sense_buffer, resp->sense,
>                        min_t(u32,
>                              virtio32_to_cpu(vscsi->vdev, resp->sense_len),
>                              VIRTIO_SCSI_SENSE_SIZE));
>                 set_status_byte(sc, SAM_STAT_CHECK_CONDITION);
>         }
> 
> What am I missing?
> 
Indeed, you are right. Will be fixing it up.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		           Kernel Storage Architect
hare@xxxxxxx			                  +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), GF: Felix Imendörffer



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux