Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2000363imm; Sat, 6 Oct 2018 15:48:12 -0700 (PDT) X-Google-Smtp-Source: ACcGV626g3G7VW7eWK2vr+kM5YlaK4YAgzGsc2AgdVKuvlufeCJHUz3kM3ZPK19kKN0lyMYB6TO2 X-Received: by 2002:a17:902:9696:: with SMTP id n22-v6mr17725662plp.212.1538866092420; Sat, 06 Oct 2018 15:48:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538866092; cv=none; d=google.com; s=arc-20160816; b=EQcXZKaS3ETLkhhY3FXXyr3lXVFulGF4NrFBdmyRN1A7i1cXt8Upk4EFR+N1xCo+3s F47bCGo6DwQ6P0MiDX/Y4DvBXSDZRTk0alMiwZO2PYVNfI0fnvTaKrZBSAmNtjo5lM79 p6RG/MTWH4nuz7mFpBxjCpWrt4IpUkqTt5U73mSLvU4ro3OnZTLY1azeKyMf04dhOp0J L/hZlY9tQpLqCo+6eJ9ZWGj1BYonAVPhyuYMPqCHfYH8w4J4zy+AtmeTWmK3MAmdFozM XrpwkYp7btDOsp3/yfY70HoZAXaW50+mRRIIMS75cdMsTJ0PFbGPM46wGKjbRn+Rr66I /y+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=NZBjo2aGfpTjJRn918klV4zqOc8QA4M8zsX7haRhh2k=; b=LSAcGapyVjvjrHPqtruXEJ4FmxI2/yEhKsBcSroL1LJGLPVyC3rdkotINwi1LRNhSD 6gFg4vbhRw+9elgrFDl5J3wmbw5k91QqhMlXfijVzgOxznUdgkA8pfpo8nrfdhxCXFO4 OwfyHHVjb8YhlAhjdNJfjofbTsBGmqPPgnPezQFTM59miTsWFxEGqb9QA27JbKN/GI+m AaGfj5ice1Ypo0h3Iz2vJZdwdeE35MvjqKUdIDTumR3sIF8GBeyXjhH9V8NjxssHYDan n1ID3KUlR8Wb7wfFLjdeiVO3n1cSNtZb+bK/Wo95vZmSFAglvx/5A7qCG6RcQYR/hcjD AMHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=G2fhd4zh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t8-v6si12687911plo.319.2018.10.06.15.47.42; Sat, 06 Oct 2018 15:48:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=G2fhd4zh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726204AbeJGFwk (ORCPT + 99 others); Sun, 7 Oct 2018 01:52:40 -0400 Received: from imap.thunk.org ([74.207.234.97]:43430 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725821AbeJGFwk (ORCPT ); Sun, 7 Oct 2018 01:52:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=NZBjo2aGfpTjJRn918klV4zqOc8QA4M8zsX7haRhh2k=; b=G2fhd4zhcsvxg0xVJYL4q2mMqP wOwexAbxrp9LMg1xBlUwLhVjvREw6Z/JMjtUVcWY0ratjd0JpJ93lWZ0ysd0U7tQD1anXGTfDro8I od2epYH3gDBBPhtWz5DOCNHiaoL4IZbKdkVcILHSCcj2Op9xqs51v9OtG+ypM0vpj3o8=; Received: from root (helo=callcc.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.89) (envelope-from ) id 1g8vMB-0004hI-2K; Sat, 06 Oct 2018 22:47:31 +0000 Received: by callcc.thunk.org (Postfix, from userid 15806) id 08A247A5240; Sat, 6 Oct 2018 18:47:30 -0400 (EDT) Date: Sat, 6 Oct 2018 18:47:29 -0400 From: "Theodore Y. Ts'o" To: Joel Fernandes Cc: "Paul E. McKenney" , linux-kernel@vger.kernel.org, Jonathan Corbet , Josh Triplett , Lai Jiangshan , linux-doc@vger.kernel.org, Mathieu Desnoyers , Steven Rostedt , pantin@google.com Subject: Re: [PATCH RFC 0/5] rcu doc updates for whatisRCU and checklist Message-ID: <20181006224729.GA7130@thunk.org> Mail-Followup-To: "Theodore Y. Ts'o" , Joel Fernandes , "Paul E. McKenney" , linux-kernel@vger.kernel.org, Jonathan Corbet , Josh Triplett , Lai Jiangshan , linux-doc@vger.kernel.org, Mathieu Desnoyers , Steven Rostedt , pantin@google.com References: <20181005231815.170433-1-joel@joelfernandes.org> <20181005234628.GB2548@thunk.org> <20181006034540.GM2674@linux.ibm.com> <20181006044057.GA41279@joelaf.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181006044057.GA41279@joelaf.mtv.corp.google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 05, 2018 at 09:40:57PM -0700, Joel Fernandes wrote: > > Could you annotate this pointer (sbi->s_qf_names) with __rcu so it can be > checked by sparse for proper usage? Its also point #16 in the checklist.txt > RCU document. I enclosed a diff to do this below. Sure. > I also saw a bunch of places in super.c where the pointer isn't accessed from > an rcu read section or rcu_dereference, but it was a quick look so sorry if I > missed something. If its true, then are you planning to convert these to use > rcu_dereference and wrapped by an rcu_read_lock/unlock as well? These are places where we are holding s_umount, so there's no way s_qf_names can change out from under us. So the conversion should be to use rcu_dereference_protected(). > > + to_free[i] = rcu_dereference_protected(sbi->s_qf_names[i], > > + &sb->s_umount); > > Also should this be the following? > to_free[i] = rcu_dereference_protected(sbi->s_qf_names[i], > lockdep_is_held(&sb->s_umount)); Yep, good catch, thanks. - Ted