Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57C6EC2D0A8 for ; Sat, 26 Sep 2020 14:49:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E28820BED for ; Sat, 26 Sep 2020 14:49:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729453AbgIZOtE (ORCPT ); Sat, 26 Sep 2020 10:49:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725208AbgIZOtE (ORCPT ); Sat, 26 Sep 2020 10:49:04 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 407F6C0613CE for ; Sat, 26 Sep 2020 07:49:04 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kMBVW-006gc6-U6; Sat, 26 Sep 2020 14:49:03 +0000 Date: Sat, 26 Sep 2020 15:49:02 +0100 From: Al Viro To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 3/4] fs: pass a nameidata into filename_lookup Message-ID: <20200926144902.GZ3421308@ZenIV.linux.org.uk> References: <20200926092051.115577-1-hch@lst.de> <20200926092051.115577-4-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200926092051.115577-4-hch@lst.de> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Sat, Sep 26, 2020 at 11:20:50AM +0200, Christoph Hellwig wrote: > This allows keeping the LOOKUP_ROOT case for vfs_path_lookup entirely > out of the normal fast path. ... saving you all of a if (unlikely(root)) {....} on it. Not worth it, and > + struct nameidata nd; > + > + return filename_lookup(AT_FDCWD, getname_kernel(name), flags, path, > + &nd); is something I would rather avoid on the general principles - better have set_nameidata()/restore_nameidata() done always to a local variable. Makes for somewhat easier analysis. IOW, NAK