Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756782AbbEVI02 (ORCPT ); Fri, 22 May 2015 04:26:28 -0400 Received: from verein.lst.de ([213.95.11.211]:60646 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756613AbbEVI0R (ORCPT ); Fri, 22 May 2015 04:26:17 -0400 Date: Fri, 22 May 2015 10:26:14 +0200 From: Christoph Hellwig To: "Nicholas A. Bellinger" Cc: target-devel , linux-scsi , linux-kernel , Hannes Reinecke , Christoph Hellwig , Sagi Grimberg , "Paul E. McKenney" , Nicholas Bellinger Subject: Re: [PATCH-v2 2/9] target/pr: Use atomic bitop for se_dev_entry->pr_reg reservation check Message-ID: <20150522082614.GA24640@lst.de> References: <1432275071-28882-1-git-send-email-nab@daterainc.com> <1432275071-28882-3-git-send-email-nab@daterainc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1432275071-28882-3-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 Content-Length: 1215 Lines: 30 On Fri, May 22, 2015 at 06:11:04AM +0000, Nicholas A. Bellinger wrote: > + clear_bit(1, &orig->pr_reg); Can you call it ->flags and give the bit a meaningful name? > diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c > index c0b593a..d29b39c 100644 > --- a/drivers/target/target_core_pr.c > +++ b/drivers/target/target_core_pr.c > @@ -327,9 +327,13 @@ static int core_scsi3_pr_seq_non_holder( > int we = 0; /* Write Exclusive */ > int legacy = 0; /* Act like a legacy device and return > * RESERVATION CONFLICT on some CDBs */ > + bool registered = false; > > rcu_read_lock(); > se_deve = target_nacl_find_deve(nacl, cmd->orig_fe_lun); > + if (se_deve) > + registered = test_bit(1, &se_deve->pr_reg); > + rcu_read_unlock(); It would be good to just sort out the registered and co variables here before the RCU changes, as in: http://git.infradead.org/users/hch/scsi.git/commitdiff/6372d9f62c83acb30d051387c40deb4dbdcaa376 -- 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/