[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CCFAFEBB-8250-4627-B25D-3B9054954C45@nutanix.com>
Date: Tue, 8 Sep 2020 17:53:16 +0000
From: Felipe Franciosi <felipe@...anix.com>
To: Paolo Bonzini <pbonzini@...hat.com>,
"stable@...r.kernel.org" <stable@...r.kernel.org>
CC: Matej Genci <matej.genci@...anix.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"mst@...hat.com" <mst@...hat.com>,
"jasowang@...hat.com" <jasowang@...hat.com>,
"stefanha@...hat.com" <stefanha@...hat.com>,
"jejb@...ux.ibm.com" <jejb@...ux.ibm.com>,
"martin.petersen@...cle.com" <martin.petersen@...cle.com>,
"virtualization@...ts.linux-foundation.org"
<virtualization@...ts.linux-foundation.org>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>
Subject: Re: [PATCH] Rescan the entire target on transport reset when LUN is 0
> On Sep 8, 2020, at 3:22 PM, Paolo Bonzini <pbonzini@...hat.com> wrote:
>
> On 28/08/20 14:21, Matej Genci wrote:
>> VirtIO 1.0 spec says
>> The removed and rescan events ... when sent for LUN 0, they MAY
>> apply to the entire target so the driver can ask the initiator
>> to rescan the target to detect this.
>>
>> This change introduces the behaviour described above by scanning the
>> entire scsi target when LUN is set to 0. This is both a functional and a
>> performance fix. It aligns the driver with the spec and allows control
>> planes to hotplug targets with large numbers of LUNs without having to
>> request a RESCAN for each one of them.
>>
>> Signed-off-by: Matej Genci <matej@...anix.com>
>> Suggested-by: Felipe Franciosi <felipe@...anix.com>
>> ---
>> drivers/scsi/virtio_scsi.c | 7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
>> index bfec84aacd90..a4b9bc7b4b4a 100644
>> --- a/drivers/scsi/virtio_scsi.c
>> +++ b/drivers/scsi/virtio_scsi.c
>> @@ -284,7 +284,12 @@ static void virtscsi_handle_transport_reset(struct virtio_scsi *vscsi,
>>
>> switch (virtio32_to_cpu(vscsi->vdev, event->reason)) {
>> case VIRTIO_SCSI_EVT_RESET_RESCAN:
>> - scsi_add_device(shost, 0, target, lun);
>> + if (lun == 0) {
>> + scsi_scan_target(&shost->shost_gendev, 0, target,
>> + SCAN_WILD_CARD, SCSI_SCAN_INITIAL);
>> + } else {
>> + scsi_add_device(shost, 0, target, lun);
>> + }
>> break;
>> case VIRTIO_SCSI_EVT_RESET_REMOVED:
>> sdev = scsi_device_lookup(shost, 0, target, lun);
>>
>
>
> Acked-by: Paolo Bonzini <pbonzini@...hat.com>
Cc: stable@...r.kernel.org
Thanks, Paolo.
I'm Cc'ing stable as I believe this fixes a driver bug where it
doesn't follow the spec. Per commit message, today devices are
required to issue RESCAN events for each LUN behind a target when
hotplugging, or risking the driver not seeing the new LUNs.
Is this enough? Or should we resend after merge per below?
https://www.kernel.org/doc/Documentation/process/stable-kernel-rules.rst
F.
Powered by blists - more mailing lists