Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2338057yba; Sat, 27 Apr 2019 21:40:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqyAZ4jBA93pqW6f5bn+i79ijUqcKDvy25Wj5d8ag7EeB7Ex3gh2VPI+9p03gIRwFWFUK8bM X-Received: by 2002:a63:4411:: with SMTP id r17mr30764021pga.275.1556426411429; Sat, 27 Apr 2019 21:40:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556426411; cv=none; d=google.com; s=arc-20160816; b=WyrJCmdH54I6FgSd8XqmeHAKdE3EVr3hjMxgqd7+0cbyJeOfJNOwWvyl5qeZYL4j3D DQDTlJZBJD/vsMQ33uQPJHAtqAxYxy3AUVg7QuV47tgvRbZRD/N2E1KXC3JGXNAFyEIz SynjCL2aeesg4iAuDYVm6Yyd/j4Rp7/sQeuq2Hg80RVS5G0l2GoQZ8h2B6LPhH8d7GSB +qHdCnN1UBclVnRdZUzSAfbXCdb1qVSCO0BQNRZFpanEhr3ry6ymeQr7Dzl5jOjMk4c8 SURGUbtzFNDFZpvXEoQxbHZseRXpViuSePeDnv8JX6byrZuxewzfFPts+JT/pf06rUjQ gTNg== 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=1mmjHfroGI21mkbfuSFXhLBV1WHqQlK1WWMCHwbFg5Q=; b=zD7qDti3zAw2COqRtKZaLzyB9+dlGPC/4OxleruQXO+PyVI1C39Fr7RBIOItOUGnyE TAxXOyPcBMaxH7o/in1hEp/icSXThDchtf8s9rquEtOgVegjg4ne2ftpmYLJuM2sSGGE oqfQ6P7FIawB/ZikxAT7nRdoUbb0Lf5A4aPCsPnLBB55IhIazq8s72hBb/4lsl1/VK+q AFeskyxEq67i3dnAyuurZSyJrsm8yomowkzuvDk23FKCMFOpp/uX3sKjGhkhnXxAlDoT WYBdS3fhtsKY6YWV6L+mpjr6z+BGmOssUdiT/MFLrOblpzfLcBKO6ORT/Ozi7hduMfJL Jt7g== 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 n13si28504287pgl.348.2019.04.27.21.39.45; Sat, 27 Apr 2019 21:40:11 -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 S1726253AbfD1Ei0 (ORCPT + 99 others); Sun, 28 Apr 2019 00:38:26 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:33944 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725909AbfD1Ei0 (ORCPT ); Sun, 28 Apr 2019 00:38:26 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1hKbZs-0007cv-JT; Sun, 28 Apr 2019 04:38:13 +0000 Date: Sun, 28 Apr 2019 05:38:12 +0100 From: Al Viro To: Jeff Layton Cc: Linus Torvalds , Ilya Dryomov , ceph-devel@vger.kernel.org, Linux List Kernel Mailing Subject: Re: [GIT PULL] Ceph fixes for 5.1-rc7 Message-ID: <20190428043801.GE2217@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> <20190426165055.GY2217@ZenIV.linux.org.uk> 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 01:30:53PM -0400, Jeff Layton wrote: > > I _probably_ would take allocation out of the loop (e.g. make it > > __getname(), called unconditionally) and turned it into the > > d_path.c-style read_seqbegin_or_lock()/need_seqretry()/done_seqretry() > > loop, so that the first pass would go under rcu_read_lock(), while > > the second (if needed) would just hold rename_lock exclusive (without > > bumping the refcount). But that's a matter of (theoretical) livelock > > avoidance, not the locking correctness for ->d_name accesses. > > > > Yeah, that does sound better. I want to think about this code a bit FWIW, is there any reason to insist that the pathname is put into the beginning of the buffer? I mean, instead of path + pathlen we might return path + offset, with the pathname going from path + offset to path + PATH_MAX - 1 inclusive, with path being the thing eventually freed. It's easier to build the string backwards, seeing that we are walking from leaf to root...