diff mbox series

[2/2] scsi: smartpqi: check sdev in pqi_scsi_find_entry

Message ID 20200616153145.16949-2-mwilck@suse.com (mailing list archive)
State Changes Requested
Headers show
Series [1/2] scsi: smartpqi: grab scsi device ref in slave_configure() | expand

Commit Message

Martin Wilck June 16, 2020, 3:31 p.m. UTC
From: Martin Wilck <mwilck@suse.com>

If a scsi device has been destroyed e.g. using the sysfs "delete"
attribute, subsequent host rescans won't re-discover it. This
patch makes it work at least via the smartqpi-specific "rescan"
sysfs attribute.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 drivers/scsi/smartpqi/smartpqi_init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Seymour, Shane M June 16, 2020, 11:44 p.m. UTC | #1
Reviewed-by: Shane Seymour <shane.seymour@hpe.com>

> -----Original Message-----
> From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-
> owner@vger.kernel.org] On Behalf Of mwilck@suse.com
> Sent: Wednesday, 17 June 2020 1:32 AM
> To: Don Brace <don.brace@microsemi.com>; Martin K. Petersen
> <martin.petersen@oracle.com>
> Cc: esc.storagedev@microsemi.com; linux-scsi@vger.kernel.org; Martin
> Wilck <mwilck@suse.com>
> Subject: [PATCH 2/2] scsi: smartpqi: check sdev in pqi_scsi_find_entry
> 
> From: Martin Wilck <mwilck@suse.com>
> 
> If a scsi device has been destroyed e.g. using the sysfs "delete"
> attribute, subsequent host rescans won't re-discover it. This
> patch makes it work at least via the smartqpi-specific "rescan"
> sysfs attribute.
> 
> Signed-off-by: Martin Wilck <mwilck@suse.com>
> ---
>  drivers/scsi/smartpqi/smartpqi_init.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/smartpqi/smartpqi_init.c
> b/drivers/scsi/smartpqi/smartpqi_init.c
> index 54a72f465f85..87089b67ff74 100644
> --- a/drivers/scsi/smartpqi/smartpqi_init.c
> +++ b/drivers/scsi/smartpqi/smartpqi_init.c
> @@ -1612,7 +1612,8 @@ static enum pqi_find_result
> pqi_scsi_find_entry(struct pqi_ctrl_info *ctrl_info,
>  			device->scsi3addr)) {
>  			*matching_device = device;
>  			if (pqi_device_equal(device_to_find, device)) {
> -				if (device_to_find->volume_offline)
> +				if (device_to_find->volume_offline ||
> +				    !pqi_get_scsi_device(device))
>  					return DEVICE_CHANGED;
>  				return DEVICE_SAME;
>  			}
> --
> 2.26.2
diff mbox series

Patch

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 54a72f465f85..87089b67ff74 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -1612,7 +1612,8 @@  static enum pqi_find_result pqi_scsi_find_entry(struct pqi_ctrl_info *ctrl_info,
 			device->scsi3addr)) {
 			*matching_device = device;
 			if (pqi_device_equal(device_to_find, device)) {
-				if (device_to_find->volume_offline)
+				if (device_to_find->volume_offline ||
+				    !pqi_get_scsi_device(device))
 					return DEVICE_CHANGED;
 				return DEVICE_SAME;
 			}