From: wangyijing <wangyijing@huawei.com>
To: John Garry <john.garry@huawei.com>,
Dan Williams <dan.j.williams@intel.com>
Cc: jejb@linux.vnet.ibm.com,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi <linux-scsi@vger.kernel.org>,
john.garry2@mail.dcu.ie,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linuxarm@huawei.com, lindar_liu@usish.com,
Tejun Heo <tj@kernel.org>,
jinpu.wang@profitbricks.com
Subject: Re: [RFC PATCH] scsi: libsas: fix WARN on device removal
Date: Fri, 11 Nov 2016 16:12:02 +0800 [thread overview]
Message-ID: <58257D52.6090507@huawei.com> (raw)
In-Reply-To: <9870e7bc-a472-1913-1930-ac022e8ad5e8@huawei.com>
>
> They're not the same. I don't see how your solution properly deals with remote sas_port deletion.
>
> When we unplug a device connected to an expander, can't the sas_port be deleted twice, in sas_unregister_devs_sas_addr() from domain revalidation and also now in sas_destruct_devices()? I think that this gives a NULL dereference.
> And we still get the WARN as the sas_port has still been deleted before the device.
>
> In my solution, we should always delete the sas_port after the attached device.
>
>>>
>>> i.e. it moves the port destruction to the workqueue and still suffers
>>> from the flutter problem:
>>>
>>> http://marc.info/?l=linux-scsi&m=143801026028006&w=2
>>> http://marc.info/?l=linux-scsi&m=143801971131073&w=2
>>>
>>> Perhaps we instead need to quiet this warning?
>>>
>>> http://marc.info/?l=linux-scsi&m=143802229932175&w=2
>
> I have not seen the flutter issue. I am just trying to solve the horrible WARN dump.
> However I do understand that there may be a issue related to how we queue the events; there was a recent attempt to fix this, but it came to nothing:
> https://www.spinics.net/lists/linux-scsi/msg99991.html
We found libsas hotplug several problems:
1. sysfs warning calltrace(like the case you found);
2. hot-add and hot-remove work events may process out of order;
3. in some extreme cases, libsas may miss some events, if the same event is still pending in workqueue.
It's a complex issue, we posted two patches, try to fix these issues, but now few people are interested in it :(
>
> Cheers,
> John
>
>>
>> Alternatively we need a mechanism to cancel in-flight port shutdown
>> requests when we start re-attaching devices before queued port
>> destruction events have run.
>>
>> .
>>
>
>
> _______________________________________________
> linuxarm mailing list
> linuxarm@huawei.com
> http://rnd-openeuler.huawei.com/mailman/listinfo/linuxarm
>
> .
>
WARNING: multiple messages have this Message-ID (diff)
From: wangyijing <wangyijing@huawei.com>
To: John Garry <john.garry@huawei.com>,
Dan Williams <dan.j.williams@intel.com>
Cc: <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi <linux-scsi@vger.kernel.org>,
<john.garry2@mail.dcu.ie>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
<linuxarm@huawei.com>, <lindar_liu@usish.com>,
Tejun Heo <tj@kernel.org>, <jinpu.wang@profitbricks.com>
Subject: Re: [RFC PATCH] scsi: libsas: fix WARN on device removal
Date: Fri, 11 Nov 2016 16:12:02 +0800 [thread overview]
Message-ID: <58257D52.6090507@huawei.com> (raw)
In-Reply-To: <9870e7bc-a472-1913-1930-ac022e8ad5e8@huawei.com>
>
> They're not the same. I don't see how your solution properly deals with remote sas_port deletion.
>
> When we unplug a device connected to an expander, can't the sas_port be deleted twice, in sas_unregister_devs_sas_addr() from domain revalidation and also now in sas_destruct_devices()? I think that this gives a NULL dereference.
> And we still get the WARN as the sas_port has still been deleted before the device.
>
> In my solution, we should always delete the sas_port after the attached device.
>
>>>
>>> i.e. it moves the port destruction to the workqueue and still suffers
>>> from the flutter problem:
>>>
>>> http://marc.info/?l=linux-scsi&m=143801026028006&w=2
>>> http://marc.info/?l=linux-scsi&m=143801971131073&w=2
>>>
>>> Perhaps we instead need to quiet this warning?
>>>
>>> http://marc.info/?l=linux-scsi&m=143802229932175&w=2
>
> I have not seen the flutter issue. I am just trying to solve the horrible WARN dump.
> However I do understand that there may be a issue related to how we queue the events; there was a recent attempt to fix this, but it came to nothing:
> https://www.spinics.net/lists/linux-scsi/msg99991.html
We found libsas hotplug several problems:
1. sysfs warning calltrace(like the case you found);
2. hot-add and hot-remove work events may process out of order;
3. in some extreme cases, libsas may miss some events, if the same event is still pending in workqueue.
It's a complex issue, we posted two patches, try to fix these issues, but now few people are interested in it :(
>
> Cheers,
> John
>
>>
>> Alternatively we need a mechanism to cancel in-flight port shutdown
>> requests when we start re-attaching devices before queued port
>> destruction events have run.
>>
>> .
>>
>
>
> _______________________________________________
> linuxarm mailing list
> linuxarm@huawei.com
> http://rnd-openeuler.huawei.com/mailman/listinfo/linuxarm
>
> .
>
next prev parent reply other threads:[~2016-11-11 8:20 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-03 14:58 [RFC PATCH] scsi: libsas: fix WARN on device removal John Garry
2016-11-03 14:58 ` John Garry
2016-11-09 12:28 ` John Garry
2016-11-09 12:28 ` John Garry
2016-11-09 17:36 ` John Garry
2016-11-09 17:36 ` John Garry
2016-11-09 19:09 ` Dan Williams
2016-11-09 20:35 ` Dan Williams
2016-11-10 11:53 ` John Garry
2016-11-10 11:53 ` John Garry
2016-11-11 8:12 ` wangyijing [this message]
2016-11-11 8:12 ` wangyijing
2016-11-11 8:23 ` John Garry
2016-11-11 8:23 ` John Garry
2016-11-11 8:49 ` wangyijing
2016-11-11 8:49 ` wangyijing
2016-11-17 15:23 ` John Garry
2016-11-17 15:23 ` John Garry
2016-11-18 1:51 ` Martin K. Petersen
2016-11-18 1:51 ` Martin K. Petersen
2016-11-18 1:53 ` Dan Williams
2016-11-18 9:00 ` John Garry
2016-11-18 9:00 ` John Garry
2016-11-18 19:08 ` Dan Williams
2016-11-21 15:16 ` John Garry
2016-11-21 15:16 ` John Garry
2016-11-21 17:13 ` Dan Williams
2016-11-22 16:56 ` John Garry
2016-11-22 16:56 ` John Garry
2016-11-23 1:07 ` wangyijing
2016-11-23 1:07 ` wangyijing
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=58257D52.6090507@huawei.com \
--to=wangyijing@huawei.com \
--cc=dan.j.williams@intel.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=jinpu.wang@profitbricks.com \
--cc=john.garry2@mail.dcu.ie \
--cc=john.garry@huawei.com \
--cc=lindar_liu@usish.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=martin.petersen@oracle.com \
--cc=tj@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.