From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752881AbbEMFzy (ORCPT ); Wed, 13 May 2015 01:55:54 -0400 Received: from verein.lst.de ([213.95.11.211]:48303 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751005AbbEMFzw (ORCPT ); Wed, 13 May 2015 01:55:52 -0400 Date: Wed, 13 May 2015 07:55:50 +0200 From: Christoph Hellwig To: "Nicholas A. Bellinger" Cc: target-devel , linux-scsi , linux-kernel , Hannes Reinecke , Christoph Hellwig , Sagi Grimberg , Nicholas Bellinger Subject: Re: [PATCH 05/12] target: Convert transport_lookup_*_lun to RCU reader Message-ID: <20150513055550.GD20825@lst.de> References: <1431422736-29125-1-git-send-email-nab@daterainc.com> <1431422736-29125-6-git-send-email-nab@daterainc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1431422736-29125-6-git-send-email-nab@daterainc.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > + rcu_read_lock(); > + deve = target_nacl_find_deve(nacl, unpacked_lun); > + if (deve && deve->lun_flags & TRANSPORT_LUNFLAGS_INITIATOR_ACCESS) { > + /* > + * Make sure that target_enable_device_list_for_node() > + * has not already cleared the RCU protected pointers. > + */ > + if (!deve->se_lun) { Just move the hlist_del_rcu in core_disable_device_list_for_node before clearing se_lun and this check won't be needed. And if you need ny check here just add it to the if so that there is no need for the goto. Same for the TMR path. As for the locking changes: I'd rather have the change to a mutex as a separate patch as that's different from the data structure changes.