Re: [PATCH] pm8001: panics/lockups from asynchronous device removal.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 17, 2012 at 10:29 AM, Mark Salyzyn <mark_salyzyn@xxxxxxxxxxx> wrote:
> 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@xxxxxxxxxxx
> Cc: jack_wang@xxxxxxxxx
> Cc: JBottomley@xxxxxxxxxxxxx
> Cc: crystal_yu@xxxxxxxxx
> Cc: john_gong@xxxxxxxxx
> Cc: lindar_liu <lindar_liu@xxxxxxxxx>

While your in the area of libsas error handling, mind weighing in on
the pending libsas error handling rework backlog?

http://git.kernel.org/?p=linux/kernel/git/djbw/isci.git;a=shortlog;h=refs/heads/libsas-eh-reworks-v4


...more notes below:

> @@ -986,7 +997,8 @@ int pm8001_abort_task(struct sas_task *task)
>        struct pm8001_device *pm8001_dev;
>        struct pm8001_tmf_task tmf_task;
>        int rc = TMF_RESP_FUNC_FAILED;
> -       if (unlikely(!task || !task->lldd_task || !task->dev))
> +       if (unlikely(!task || !task->lldd_task
> +        || !task->dev || !task->dev->lldd_dev))

Hmm some of these are "never can happen" checks, so if you are indeed
seeing !task or !task->dev something is very wrong in libsas. checking
task->lldd_task and task->dev->lldd_dev should be all that is
required.

Also, I think it confuses the situation to return TMF_RESP_FUNC_FAILED
in this case because the truth of the matter, as far as error handling
is concerned, is that the lldd has forgotten the task, but you would
need to check that the lldd does not subsequently call task->task_done
in some other path.

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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux