Hi Martin and Junichi, On 04/03/2017 11:10 PM, Junichi Nomura wrote:
On 04/04/17 06:53, Mauricio Faria de Oliveira wrote:
On 03/28/2017 11:29 PM, Junichi Nomura wrote:Since commit 895427bd012c ("scsi: lpfc: NVME Initiator: Base modifications"), "rmmod lpfc" starting to cause panic or corruption due to double free.
Thanks for the report. Can you please check whether the patch just sent ([PATCH] lpfc: fix double free of bound CQ/WQ ring pointer) resolves it?
It works for me. Thank you!
Excellent, thanks! Martin, can you review/consider it for 4.11-rc6, please?
Considering future maintenance, it might be a bit fragile to just depend on the code comment about representing the relation between cq/wq and shared pring but it's maintainers' choice.
I agree -- there should be a better way of identifying a bound WQ/CQ. Perhaps there is, but I couldn't find it currently. For now, as far as I could grep and examine the code (detailed in commit message), a WQ is always bound to a CQ, so to check for WQ and not free its ring pointer seems to be sufficient (as the CQ ring pointer is freed first). If that changes, probably some form of flagging and/or queue type determination would be better/necessary. cheers, -- Mauricio Faria de Oliveira IBM Linux Technology Center

