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 8CB32C433ED for ; Wed, 19 May 2021 08:07:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 69AB861007 for ; Wed, 19 May 2021 08:07:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236256AbhESIIf (ORCPT ); Wed, 19 May 2021 04:08:35 -0400 Received: from mga01.intel.com ([192.55.52.88]:28069 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235683AbhESIIb (ORCPT ); Wed, 19 May 2021 04:08:31 -0400 IronPort-SDR: COl2Nu6Dd9AE5Ne0QP0ESgfVUGHUOc3b2+3RPAqqw7Uk6rNIvfy0+lVz59tG4PeK5xcFkcocqi zK915tXQNlTw== X-IronPort-AV: E=McAfee;i="6200,9189,9988"; a="221984080" X-IronPort-AV: E=Sophos;i="5.82,312,1613462400"; d="scan'208";a="221984080" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2021 01:07:12 -0700 IronPort-SDR: +m6QThSTl14NxX0mj/VRdu4CnV61XHCXHOpwQDCABkD55XFK7ns2/d36Ij8WIWZh2o4cI7wOQs 2TGdrPwoRnXg== X-IronPort-AV: E=Sophos;i="5.82,312,1613462400"; d="scan'208";a="627525656" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 May 2021 01:07:08 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1ljHEO-00DAfC-Ef; Wed, 19 May 2021 11:07:04 +0300 Date: Wed, 19 May 2021 11:07:04 +0300 From: Andy Shevchenko To: Al Viro Cc: Linus Torvalds , Jia He , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Rasmus Villemoes , Jonathan Corbet , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , "Eric W . Biederman" , "Darrick J. Wong" , "Peter Zijlstra (Intel)" , Ira Weiny , Eric Biggers , "Ahmed S. Darwish" , "open list:DOCUMENTATION" , Linux Kernel Mailing List , linux-s390 , linux-fsdevel Subject: Re: [PATCH 12/14] d_path: prepend_path(): lift the inner loop into a new helper Message-ID: References: <20210519004901.3829541-1-viro@zeniv.linux.org.uk> <20210519004901.3829541-12-viro@zeniv.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210519004901.3829541-12-viro@zeniv.linux.org.uk> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 19, 2021 at 12:48:59AM +0000, Al Viro wrote: > ... and leave the rename_lock/mount_lock handling in prepend_path() > itself ... > + if (!IS_ERR_OR_NULL(mnt_ns) && !is_anon_ns(mnt_ns)) > + return 1; // absolute root > + else > + return 2; // detached or not attached yet Would it be slightly better to read if (IS_ERR_OR_NULL(mnt_ns) || is_anon_ns(mnt_ns)) return 2; // detached or not attached yet else return 1; // absolute root ? Oh, I have noticed that it's in the original piece of code (perhaps separate change if we ever need it?). -- With Best Regards, Andy Shevchenko