From: "Jack Wang" <jack_wang@usish.com>
To: 'Mark Salyzyn' <mark_salyzyn@xyratex.com>,
'linux-scsi' <linux-scsi@vger.kernel.org>
Cc: 'crystal_yu' <crystal_yu@usish.com>,
'lindar_liu' <lindar_liu@usish.com>,
'James Bottomley' <JBottomley@parallels.com>
Subject: RE: [PATCH] pm8001: panics/lockups from asynchronous device removal.
Date: Wed, 18 Jan 2012 09:37:45 +0800 [thread overview]
Message-ID: <76FDDB1AAADD45AC9478B974333A04D7@usish.com.cn> (raw)
In-Reply-To: <09A902B5-56B8-46CB-82B7-0DF81E7BBC12@xyratex.com>
RE [PATCH] pm8001: panics/lockups from asynchronous device removal.
>
> pm8001_query_task() and pm8001_abort_task() panic kernel when devices
> asynchronously disappear, a possible scenario since these functions are
> generally called when errors are mounting. Some of the panics are a direct
> result of a failure to NULL check some of the structure variables that are
in
> certain states of teardown. One of the lockups was a direct result of
returning
> an unexpected code to libsas' sas_scsi_find_task() function (creating a
tight
> loop of an unexpected code 138 upstream to the scsi layer queue function).
>
> Signed-off-by: mark_salyzyn@xyratex.com
> Cc: jack_wang@usish.com
> Cc: JBottomley@parallels.com
> Cc: crystal_yu@usish.com
> Cc: john_gong@usish.com
> Cc: lindar_liu <lindar_liu@usish.com>
>
> drivers/scsi/pm8001/pm8001_sas.c | 22 ++++++++++++++++++----
> 1 file changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/scsi/pm8001/pm8001_sas.c
> b/drivers/scsi/pm8001/pm8001_sas.c
> index fb3dc99..1cac756 100644
> --- a/drivers/scsi/pm8001/pm8001_sas.c
> +++ b/drivers/scsi/pm8001/pm8001_sas.c
> @@ -940,6 +940,8 @@ int pm8001_query_task(struct sas_task *task)
> struct pm8001_hba_info *pm8001_ha =
> pm8001_find_ha_by_dev(dev);
>
> + if (unlikely(!cmnd || !cmnd->device))
> + return rc;
> int_to_scsilun(cmnd->device->lun, &lun);
> rc = pm8001_find_tag(task, &tag);
> if (rc == 0) {
> @@ -947,9 +949,11 @@ int pm8001_query_task(struct sas_task *task)
> return rc;
> }
> PM8001_EH_DBG(pm8001_ha, pm8001_printk("Query:["));
> - for (i = 0; i < 16; i++)
> - printk(KERN_INFO "%02x ", cmnd->cmnd[i]);
> - printk(KERN_INFO "]\n");
> + if (pm8001_ha->logging_level & PM8001_EH_LOGGING) {
> + for (i = 0; i < 16; i++)
> + printk(KERN_LEVEL "%02x ", cmnd->cmnd[i]);
> + printk(KERN_LEVEL "]\n");
[Jack Wang]
Here KERN_LEVEL is wrong, maybe you means KERN_INFO, others is good, thanks
for fix this.
next prev parent reply other threads:[~2012-01-18 1:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-17 18:29 [PATCH] pm8001: panics/lockups from asynchronous device removal Mark Salyzyn
2012-01-18 1:37 ` Jack Wang [this message]
2012-01-18 14:03 ` [PATCH] pm8001: panics/lockups from asynchronous device removal (take 2) Mark Salyzyn
2012-01-18 4:04 ` [PATCH] pm8001: panics/lockups from asynchronous device removal Dan Williams
2012-01-18 16:08 ` Mark Salyzyn
2012-01-18 16:27 ` Greg KH
2012-01-18 17:47 ` Dan Williams
2012-01-18 21:28 ` Mark Salyzyn
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=76FDDB1AAADD45AC9478B974333A04D7@usish.com.cn \
--to=jack_wang@usish.com \
--cc=JBottomley@parallels.com \
--cc=crystal_yu@usish.com \
--cc=lindar_liu@usish.com \
--cc=linux-scsi@vger.kernel.org \
--cc=mark_salyzyn@xyratex.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