Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161041AbbEVK14 (ORCPT ); Fri, 22 May 2015 06:27:56 -0400 Received: from mail-bl2on0055.outbound.protection.outlook.com ([65.55.169.55]:50221 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030193AbbEVK1x (ORCPT ); Fri, 22 May 2015 06:27:53 -0400 Authentication-Results: spf=pass (sender IP is 63.163.107.173) smtp.mailfrom=sandisk.com; linux.vnet.ibm.com; dkim=none (message not signed) header.d=none; X-AuditID: ac160a69-f790f6d000001879-c7-555f010aa2a5 Message-ID: <555F0107.6030102@sandisk.com> Date: Fri, 22 May 2015 12:12:23 +0200 From: Bart Van Assche 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 , "Paul E. McKenney" , Nicholas Bellinger Subject: Re: [PATCH-v2 2/9] target/pr: Use atomic bitop for se_dev_entry->pr_reg reservation check References: <1432275071-28882-1-git-send-email-nab@daterainc.com> <1432275071-28882-3-git-send-email-nab@daterainc.com> In-Reply-To: <1432275071-28882-3-git-send-email-nab@daterainc.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprPIsWRmVeSWpSXmKPExsWyRoxnkS4XY3yowYl3ahZ7Fk1isli5+iiT xeVdc9gsuq/vYLN4dW4Fk0Xb6jOMFm83f2e1uNH2gM2idelbJgdOj6UfVjF73N9+hMnjwaHN LB67bzaweTybfpjJY/Ppao/Pm+QC2KO4bFJSczLLUov07RK4Mlbe2sNWMImjonXHXcYGxv1s XYycHBICJhITDnWyQ9hiEhfurQeLCwmcYJTY3mXdxcgFZO9glDi3u4EZpuHV9YdMEEWbG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nn+lcot2pr/L+V0+SpcNo1xLjSTjF/ZL7fggFfVldr9Hu3ajlM95zN3XH1/atek jdfEFQ069XRUj4tfMDHJ3HH+VcfEh3GxVrJ7V7voHn0flZrH8lDp8T3x6UcM5l2+9Kx7yWoW kW7RGyJHPsTULWAybvfwLc88u0mJpTgj0VCLuag4EQCnO/g3KQIAAA== X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD023;1:Ftjspm7CRmcFKghBumEDwYsB7UNoCIMmQaEx5jlZRdikBdIswF/zfHTjQBrWyyQoRBz5h7H8s6delZGkUfARHKX0UpufmDmUKBhrkyeEjxhSPLP6OFkMB+c+6+2etYo0wOQqiWpqg5R3JjgkLdpfCBB9hSdp00eSJUFvk452tWiqbK6LuilChgncZLcBdE+IUjw01O1vOHSvQWUZ11oGcmFF6gcqdzJxizoI/Yv+TYLDHHfkORseltdYKXLLk1UgLpaHgordhMB/vCKNty9aW5eSrhQHj/RheVoEVzHEd3RFekou/ndxDtsZjMdbDM1QMVfeXlC4xSK3FFKtI+iW/Q== X-Forefront-Antispam-Report: CIP:63.163.107.173;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(438002)(479174004)(199003)(189002)(24454002)(164054003)(51704005)(77096005)(5001830100001)(68736005)(5001860100001)(2950100001)(50466002)(23746002)(80316001)(69596002)(81156007)(4001540100001)(77156002)(4001350100001)(59896002)(62966003)(97736004)(5001770100001)(189998001)(36756003)(5001960100002)(46102003)(106466001)(87266999)(47776003)(65816999)(54356999)(65806001)(65956001)(64706001)(50986999)(76176999)(33656002)(83506001)(64126003)(87936001)(92566002)(575784001)(86362001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR02MB286;H:milsmgep12.sandisk.com;FPR:;SPF:Pass;PTR:ErrorRetry;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR02MB286; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(520002)(3002001);SRVR:DM2PR02MB286;BCL:0;PCL:0;RULEID:;SRVR:DM2PR02MB286; X-Forefront-PRVS: 058441C12A X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2015 10:12:27.2082 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d;Ip=[63.163.107.173];Helo=[milsmgep12.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR02MB286 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1254 Lines: 38 On 05/22/15 08:11, Nicholas A. Bellinger wrote: > diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h > index e2c0eaf..def5bc8 100644 > --- a/include/target/target_core_base.h > +++ b/include/target/target_core_base.h > @@ -638,7 +638,6 @@ struct se_lun_acl { > }; > > struct se_dev_entry { > - bool def_pr_registered; > /* See transport_lunflags_table */ > u32 lun_flags; > u32 mapped_lun; > @@ -655,7 +654,8 @@ struct se_dev_entry { > struct se_node_acl *se_node_acl; > struct se_lun_acl __rcu *se_lun_acl; > spinlock_t ua_lock; > - struct se_lun *se_lun; > + struct se_lun __rcu *se_lun; > + unsigned long pr_reg; > struct list_head alua_port_list; > struct list_head ua_list; > struct hlist_node link; Hello Nic, This change causes the "se_lun = deve->se_lun" assignment in transport_lookup_cmd_lun() to assign an RCU pointer to a non-RCU pointer. Shouldn't such an assignment be protected via rcu_dereference() ? Thanks, Bart. -- 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/