lkml.org 
[lkml]   [2012]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/2] virtio-scsi: fix parsing of hotplug/hot-unplug LUN number
From
Date
On Mon, 2012-07-16 at 18:05 +0200, Paolo Bonzini wrote:
> Hotplug/hot-unplug of a LUN whose number is greater than 255
> uses the "flat" format for LUNs, which has bit 14 set. Clear
> the bit when parsing the event structs.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> drivers/scsi/virtio_scsi.c | 8 ++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
> index c7030fb..c937232 100644
> --- a/drivers/scsi/virtio_scsi.c
> +++ b/drivers/scsi/virtio_scsi.c
> @@ -252,13 +252,19 @@ static void virtscsi_cancel_event_work(struct virtio_scsi *vscsi)
> cancel_work_sync(&vscsi->event_list[i].work);
> }
>
> +static unsigned int virtscsi_get_lun(u8 *lun_bytes)
> +{
> + unsigned int lun = (lun_bytes[2] << 8) | lun_bytes[3];
> + return lun & 16383;
> +}
> +

Why are you rolling your own incomplete version of scsilun_to_int here?

James




\
 
 \ /
  Last update: 2012-07-26 11:41    [W:0.302 / U:2.972 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site