Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp866466yba; Fri, 26 Apr 2019 10:02:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbymhZzzW0aSCGEKcud1xkiFsHZvapRIIEdUTtqwaFH4lyG9QnF8Ec2MetShAbGQGWHoct X-Received: by 2002:a17:902:f209:: with SMTP id gn9mr47654090plb.109.1556298142347; Fri, 26 Apr 2019 10:02:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556298142; cv=none; d=google.com; s=arc-20160816; b=uVsbQ4zhB8oVUgEKtn1/4C6xkJZjCtajObnVpx51cfdq5Lfdd4G+6wZNv8kvNMl2W1 RicL+LtbmIbXeQ5IsT8WX1fUNMsZIP8AgzxDeegSqiTVttBY1n1wJTWeeU9/SoTE4qKl mWhdbyFUFZvpmfaIADt42DKSts3mGq5a2XK4LAv3mvelfL3geEwHsc+vOFnxCubdn1x+ LYdb1c7hok2D+fR4pDTuSAyFMClIL0ZRvbB5em9+anz4teVAR3WAhEirriqEnT1+dsH4 I1zJ+OYHwizEfdrY8qWTaMMPmaaVbIN7ccdbs1Nacu4UAA4HyhH9Lyqei2MK0yGVcFpW gW4Q== 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:message-id:subject:cc :to:from:date; bh=jdh2+SRzVum1+vwJEM2ZvPU+vkg1PaY4c4zkXWD/TwU=; b=VffLVvngIZ0SLba8He0qUOtFFZ1TslGlSObxsucGhUo2VUMDWO8/nWPcvL9oBK5Q7j nL5+6skY8millqquL+3KHVV29t8pCKduLtrG6x5GEsbnwk2E39yvdTda5RiWPX+F013m mAEFErjsVD+1ay1d/ZpeLM450agxPAH5FoNgwBUg1rDNarShAPBnuAwtZvYMOEKa+Vuv dgvEmZjlp/+aPNhIicZ7DZQ3BtlDPCUhOdqHFKqmAzhHQF5JuJ2E3HnOX2NqB+aQt65D LY3IfMElQJbYTAXjUlzk8Qp+U9/eM3mfJZ7A+Pc7/aeKpGBQpo//MqKucoOEA6UVziFD dLYQ== ARC-Authentication-Results: i=1; mx.google.com; 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 32si25420259pld.155.2019.04.26.10.02.05; Fri, 26 Apr 2019 10:02:22 -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; 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 S1726390AbfDZRBM (ORCPT + 99 others); Fri, 26 Apr 2019 13:01:12 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:39480 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726083AbfDZRBM (ORCPT ); Fri, 26 Apr 2019 13:01:12 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1hK4Dl-0003lY-0m; Fri, 26 Apr 2019 17:01:09 +0000 Date: Fri, 26 Apr 2019 18:01:08 +0100 From: Al Viro To: Linus Torvalds Cc: Jeff Layton , Ilya Dryomov , ceph-devel@vger.kernel.org, Linux List Kernel Mailing Subject: Re: [GIT PULL] Ceph fixes for 5.1-rc7 Message-ID: <20190426170108.GZ2217@ZenIV.linux.org.uk> References: <20190425174739.27604-1-idryomov@gmail.com> <342ef35feb1110197108068d10e518742823a210.camel@kernel.org> <20190425200941.GW2217@ZenIV.linux.org.uk> <86674e79e9f24e81feda75bc3c0dd4215604ffa5.camel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 26, 2019 at 09:36:00AM -0700, Linus Torvalds wrote: > On Fri, Apr 26, 2019 at 9:25 AM Jeff Layton wrote: > > > > Is it really ok to union the count and rcu_head there? > > It should be fine, because the rcu_count should only ever be used once > the count has gone to zero and the name cannot be found any more. > > And while RCU path walking may find and use the *name* after the > dentry has been killed off (but not free'd yet), all the actual > external_name() accesses should be serialized by the dentry lock, so > there's no access to those fields once the dentry is dead. It's not quite that; access to external_name contents is fine, ->d_lock or not. __d_lookup_rcu() does read it under rcu_read_lock alone. However: * we never free it without an RCU delay after the final drop of refcount. RCU delay might happen on dentry->d_rcu (if it's dentry_free()) or on name->p.rcu (if it's release_dentry_name_snapshot() or d_move() dropping the final reference). * it's never observed in ->d_name after the refcount reaches zero. * no lockless access ever looks at the refcount. It can look at ->name[], but that's it. What I don't understand is why would anyone want to mess with name snapshots for dentry_path() lookalikes...