Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755716AbbEUSK4 (ORCPT ); Thu, 21 May 2015 14:10:56 -0400 Received: from mail.linux-iscsi.org ([67.23.28.174]:45316 "EHLO linux-iscsi.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754831AbbEUSKw (ORCPT ); Thu, 21 May 2015 14:10:52 -0400 Message-ID: <1432231850.5255.10.camel@haakon3.risingtidesystems.com> Subject: Re: [PATCH 01/12] target: Convert se_node_acl->device_list[] to RCU hlist From: "Nicholas A. Bellinger" To: Christoph Hellwig Cc: "Nicholas A. Bellinger" , target-devel , linux-scsi , linux-kernel , Hannes Reinecke , Sagi Grimberg Date: Thu, 21 May 2015 11:10:50 -0700 In-Reply-To: <20150521170309.GA1172@lst.de> References: <1431422736-29125-1-git-send-email-nab@daterainc.com> <1431422736-29125-2-git-send-email-nab@daterainc.com> <20150513063555.GA21770@lst.de> <1431506771.26897.78.camel@haakon3.risingtidesystems.com> <20150517165142.GA17217@lst.de> <1431933444.24645.7.camel@haakon3.risingtidesystems.com> <20150518074102.GA6157@lst.de> <20150518080155.GA6451@lst.de> <1432015547.9093.76.camel@haakon3.risingtidesystems.com> <20150519062231.GB29468@lst.de> <20150521170309.GA1172@lst.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.4.4-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2492 Lines: 69 On Thu, 2015-05-21 at 19:03 +0200, Christoph Hellwig wrote: > On Tue, May 19, 2015 at 08:22:31AM +0200, Christoph Hellwig wrote: > > On Mon, May 18, 2015 at 11:05:47PM -0700, Nicholas A. Bellinger wrote: > > > > [ 12.830576] kernel BUG at ../drivers/target/target_core_device.c:337! > > > > > > > > > > How did you hit this..? > > > > tcm_node --block iblock_0/array /dev/sda > > > > line=$(tcm_loop --createnexus=0) > > wwn=$(echo $line | awk '{print $15}') > > tcm_loop --addlun=$wwn 0 0 iblock_0/array > > And here is the fix. Seems like anything using dynamic node ACLs was > broken the same way (I could reproduce it with vhost as well). > > I don't really like how HBA_FLAGS_INTERNAL_USE means this is a virtual > lun0, so I'll send another patch to replace it with a per-device flag > eventually. > > --- > From 9fd0e75cffde876b84b08952cc7f026d4e08d77a Mon Sep 17 00:00:00 2001 > From: Christoph Hellwig > Date: Thu, 21 May 2015 18:58:21 +0200 > Subject: target: don't add lun0 to tpg_lun_hlist > > We never want to find the virtual lun0 when looking up a lun on the TPG, > otherwise the core code gets really confused. > > Signed-off-by: Christoph Hellwig > --- > drivers/target/target_core_tpg.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c > index b8c2a32..ced1dd6 100644 > --- a/drivers/target/target_core_tpg.c > +++ b/drivers/target/target_core_tpg.c > @@ -647,7 +647,8 @@ int core_tpg_add_lun( > > lun->lun_access = lun_access; > lun->lun_status = TRANSPORT_LUN_STATUS_ACTIVE; > - hlist_add_head_rcu(&lun->link, &tpg->tpg_lun_hlist); > + if (!(dev->se_hba->hba_flags & HBA_FLAGS_INTERNAL_USE)) > + hlist_add_head_rcu(&lun->link, &tpg->tpg_lun_hlist); > > mutex_unlock(&tpg->tpg_lun_mutex); > > @@ -687,7 +688,8 @@ void core_tpg_remove_lun( > } > > lun->lun_status = TRANSPORT_LUN_STATUS_FREE; > - hlist_del_rcu(&lun->link); > + if (!(dev->se_hba->hba_flags & HBA_FLAGS_INTERNAL_USE)) > + hlist_del_rcu(&lun->link); > mutex_unlock(&tpg->tpg_lun_mutex); > > percpu_ref_exit(&lun->lun_ref); Applied to for-next, and will squash into the original series soon. --nab -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/