mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jack Wang" <jack_wang@usish.com>
To: "'Luben Tuikov'" <ltuikov@yahoo.com>,
	"'James Bottomley'" <James.Bottomley@suse.de>,
	<linux-kernel@vger.kernel.org>, <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] [SCSI] libsas: remove expander from dev list on error
Date: Wed, 27 Jul 2011 11:26:25 +0800	[thread overview]
Message-ID: <3B54164438364A3A9A2F19AFF5A4DF0A@usish.com.cn> (raw)
In-Reply-To: <1311736140.88961.YahooMailNeo@web31805.mail.mud.yahoo.com>

 [PATCH] [SCSI] libsas: remove expander from dev list on error
> 
> If expander discovery fails (sas_discover_expander()),
> remove the expander from the port device list
> (sas_ex_discover_expander()), before freeing it. Else
> the list is corrupted and, e.g., when we attempt to send
> SMP commands to other devices, the kernel oopses.
> 
> Signed-off-by: Luben Tuikov <ltuikov@yahoo.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 874e29d..f84084b 100644
> --- a/drivers/scsi/libsas/sas_expander.c
> +++ b/drivers/scsi/libsas/sas_expander.c
> @@ -849,6 +849,9 @@ static struct domain_device *sas_ex_discover_expander(
> 
>      res = sas_discover_expander(child);
>      if (res) {
> +        spin_lock_irq(&parent->port->dev_list_lock);
> +        list_del(&child->dev_list_node);
> +        spin_unlock_irq(&parent->port->dev_list_lock);
>          kfree(child);
>          return NULL;
>      }
> --
[Jack Wang] Looks reasonable, thanks for fix this.
You can add my Reviewed-by: Jack Wang <jack_wang@usish.com> if needed.


  reply	other threads:[~2011-07-27  3:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-27  3:09 Luben Tuikov
2011-07-27  3:26 ` Jack Wang [this message]
2011-07-27  4:59   ` Luben Tuikov
2011-07-27  6:02   ` Luben Tuikov
2011-07-27  6:10 Luben Tuikov
2011-07-27 20:32 ` Dan Williams
2011-08-31 16:52   ` Luben Tuikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3B54164438364A3A9A2F19AFF5A4DF0A@usish.com.cn \
    --to=jack_wang@usish.com \
    --cc=James.Bottomley@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ltuikov@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®