On 10/26/2015 09:24 AM, Tomas Henzl wrote:
On 24.10.2015 21:52, Don Brace wrote:
Abandon and reschedule rescan process only if device inquiries
fail due to mem alloc failures, which are likely to occur for
all devices.

Otherwise, skip device if inquiry fails for other reasons,
and continue rescanning process for other devices.

Reviewed-by: Scott Teel <scott.t...@pmcs.com>
Reviewed-by: Justin Lindley <justin.lind...@pmcs.com>
Reviewed-by: Kevin Barnett <kevin.barn...@pmcs.com>
Signed-off-by: Don Brace <don.br...@pmcs.com>
---
  drivers/scsi/hpsa.c |   24 +++++++++++++++++++-----
  1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 5dfb6cf..e1ee06d 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c

@@ -3799,11 +3804,20 @@ static void hpsa_update_scsi_devices(struct ctlr_info 
*h, int hostno)
                                continue;
/* Get device type, vendor, model, device id */
-               if (hpsa_update_device_info(h, lunaddrbytes, tmpdevice,
-                                                       &is_OBDR)) {
+               rc = hpsa_update_device_info(h, lunaddrbytes, tmpdevice,
+                                                       &is_OBDR);
+               if (rc == -ENOMEM) {
+                       dev_warn(&h->pdev->dev,
+                               "Out of memory, rescan stopped.\n");
What about 'rescan deferred" instead of "rescan stopped?
I can do either "rescan deferred" or "rescan rescheduled"

                        h->drv_req_rescan = 1;
-                       continue; /* skip it if we can't talk to it. */
+                       goto out;
                }
+               if (rc) {
+                       dev_warn(&h->pdev->dev,
+                               "Inquiry failed, skipping device.\n");
+                       continue;
+               }
+
                figure_bus_target_lun(h, lunaddrbytes, tmpdevice);
                hpsa_update_device_supports_aborts(h, tmpdevice, lunaddrbytes);
                this_device = currentsd[ncurrent];

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to