From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752377AbdLGW6V (ORCPT ); Thu, 7 Dec 2017 17:58:21 -0500 Received: from mail-pf0-f177.google.com ([209.85.192.177]:44333 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750973AbdLGW6T (ORCPT ); Thu, 7 Dec 2017 17:58:19 -0500 X-Google-Smtp-Source: AGs4zMY3FD+swbrxD3EWdOPR6LJWiFGBxm9VYaNoJ5Ys68dA+EaV36WQTgpx6F9bQcSf2DvBMO2nDDHCkih7NQqYoVw= MIME-Version: 1.0 In-Reply-To: <877cfb17-ba90-da91-a549-418bb6eb6391@huawei.com> References: <20171128002445.16594-1-xiyou.wangcong@gmail.com> <20171128082049.5smff3hvrkwrf77o@linux-x5ow.site> <922397da-7dd3-c24e-1d94-e4804a769331@huawei.com> <877cfb17-ba90-da91-a549-418bb6eb6391@huawei.com> From: Cong Wang Date: Thu, 7 Dec 2017 14:57:58 -0800 Message-ID: Subject: Re: [PATCH] libsas: flush pending destruct work in sas_unregister_domain_devices() To: John Garry Cc: Johannes Thumshirn , LKML , Dan Williams , Praveen Murali , "James E.J. Bottomley" , "Martin K. Petersen" , "linux-scsi@vger.kernel.org" , Jason Yan , chenxiang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 7, 2017 at 5:37 AM, John Garry wrote: > On 28/11/2017 17:04, Cong Wang wrote: >> >> I don't understand, the only caller of sas_unregister_domain_devices() >> is sas_deform_port(). >> > > And sas_deform_port() may be called from another worker on the same queue, > right? As in sas_phye_loss_of_signal()->sas_deform_port() Oh, good catch! I didn't notice this subtle call path. Do you have any better idea to fix this? We saw this on 4.9 too. > > The device destruct takes place in a separate worker from which > sas_deform_port() is called, but the same queue. So we have this queued > destruct happen after the port is fully deformed -> hence the WARN. > > I guess you only tested your patch on disks attached through an expander. I have very limited scsi hardware, so my testing is limited too.