From mboxrd@z Thu Jan 1 00:00:00 1970 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 36435C4320E for ; Wed, 1 Sep 2021 15:39:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1BDEC61057 for ; Wed, 1 Sep 2021 15:39:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343782AbhIAPki (ORCPT ); Wed, 1 Sep 2021 11:40:38 -0400 Received: from zeniv-ca.linux.org.uk ([142.44.231.140]:39610 "EHLO zeniv-ca.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244612AbhIAPkh (ORCPT ); Wed, 1 Sep 2021 11:40:37 -0400 Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLSGg-000H8s-IX; Wed, 01 Sep 2021 15:35:14 +0000 Date: Wed, 1 Sep 2021 15:35:14 +0000 From: Al Viro To: Dmitry Kadashev Cc: Jens Axboe , Christoph Hellwig , Stephen Brennan , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] namei: get rid of unused filename_parentat() Message-ID: References: <20210901150040.3875227-1-dkadashev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 01, 2021 at 03:30:56PM +0000, Al Viro wrote: > On Wed, Sep 01, 2021 at 10:00:40PM +0700, Dmitry Kadashev wrote: > > After the switch of kern_path_locked() to __filename_parentat() (to > > address use after free bug) nothing is using filename_parentat(). Also, > > filename_parentat() is inherently buggy: the "last" output arg > > always point to freed memory. > > > > Drop filename_parentat() and rename __filename_parentat() to > > filename_parentat(). > > I'd rather fold that into previous patch. > > And it might be better to fold filename_create() into its 2 callers > and rename __filename_create() as well. > > Let me poke around a bit... BTW, if you look at the only caller of filename_lookup() outside of fs/namei.c, you'll see this: f->refcnt++; /* filename_lookup() drops our ref. */ ret = filename_lookup(param->dirfd, f, flags, _path, NULL); IOW, that thing would be better off with calling the current __filename_lookup(). Might be better to rename filename_lookup to something different, turn __filename_lookup() into filename_lookup() and use _that_ in fs/fs_parser.c...