Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754059AbbELU6v (ORCPT ); Tue, 12 May 2015 16:58:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39862 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753849AbbELU6s (ORCPT ); Tue, 12 May 2015 16:58:48 -0400 Message-ID: <5552697B.8050008@redhat.com> Date: Tue, 12 May 2015 13:58:35 -0700 From: Andy Grover Organization: Red Hat User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: "Nicholas A. Bellinger" , target-devel CC: linux-scsi , linux-kernel , Hannes Reinecke , Christoph Hellwig , Sagi Grimberg , Nicholas Bellinger Subject: Re: [PATCH 03/12] target/configfs: Convert mappedlun + SCSI MIBs to RCU reader References: <1431422736-29125-1-git-send-email-nab@daterainc.com> <1431422736-29125-4-git-send-email-nab@daterainc.com> In-Reply-To: <1431422736-29125-4-git-send-email-nab@daterainc.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1866 Lines: 43 On 05/12/2015 02:25 AM, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger > > This patch converts fabric independent configfs link/unlink to use > RCU read path macros for se_node_acl->lun_entry_hlist access. > > It also converts SCSI MIB configfs show attribute code to use > RCU read path macros for se_node_acl->lun_entry_hlist access. > > Cc: Hannes Reinecke > Cc: Christoph Hellwig > Cc: Sagi Grimberg > Signed-off-by: Nicholas Bellinger > --- > drivers/target/target_core_fabric_configfs.c | 35 +++--- > drivers/target/target_core_stat.c | 180 +++++++++++++-------------- > 2 files changed, 110 insertions(+), 105 deletions(-) > > diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c > index 6cb4828..0dab6d5 100644 > --- a/drivers/target/target_core_fabric_configfs.c > +++ b/drivers/target/target_core_fabric_configfs.c > @@ -123,16 +123,16 @@ static int target_fabric_mappedlun_link( > * which be will write protected (READ-ONLY) when > * tpg_1/attrib/demo_mode_write_protect=1 > */ > - spin_lock_irq(&lacl->se_lun_nacl->device_list_lock); > - deve = lacl->se_lun_nacl->device_list[lacl->mapped_lun]; > - if (deve->lun_flags & TRANSPORT_LUNFLAGS_INITIATOR_ACCESS) > + rcu_read_lock(); > + deve = target_nacl_find_deve(lacl->se_lun_nacl, lacl->mapped_lun); > + if (deve && deve->lun_flags & TRANSPORT_LUNFLAGS_INITIATOR_ACCESS) Why do we still need TRANSPORT_LUNFLAGS_INITIATOR_ACCESS? Isn't deve being not-NULL enough? -- Andy -- 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/