Patchwork [v2,26/28] libsas: check for 'gone' expanders in smp_execute_task()

login
register
mail settings
Submitter Dan Williams
Date Dec. 23, 2011, 3 a.m.
Message ID <20111223030044.21827.27431.stgit@localhost6.localdomain6>
Download mbox | patch
Permalink /patch/132962/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Dan Williams - Dec. 23, 2011, 3 a.m.
No sense in issuing or retrying commands to an expander that has been
removed.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/scsi/libsas/sas_expander.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dan Williams - Jan. 9, 2012, 7:04 p.m.
On Thu, Dec 22, 2011 at 7:00 PM, Dan Williams <dan.j.williams@intel.com> wrote:
> No sense in issuing or retrying commands to an expander that has been
> removed.
>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
>  drivers/scsi/libsas/sas_expander.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
> index d9c2769..e2efc6c 100644
> --- a/drivers/scsi/libsas/sas_expander.c
> +++ b/drivers/scsi/libsas/sas_expander.c
> @@ -74,6 +74,9 @@ static int smp_execute_task(struct domain_device *dev, void *req, int req_size,
>
>        mutex_lock(&dev->ex_dev.cmd_mutex);
>        for (retry = 0; retry < 3; retry++) {
> +               if (dev->gone)
> +                       return -ECOMM;
> +

Test results are just now tripping up on this obvious deadlock.  Will resend.

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

Patch

diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index d9c2769..e2efc6c 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -74,6 +74,9 @@  static int smp_execute_task(struct domain_device *dev, void *req, int req_size,
 
 	mutex_lock(&dev->ex_dev.cmd_mutex);
 	for (retry = 0; retry < 3; retry++) {
+		if (dev->gone)
+			return -ECOMM;
+
 		task = sas_alloc_task(GFP_KERNEL);
 		if (!task) {
 			res = -ENOMEM;