Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4770314pxj; Tue, 22 Jun 2021 07:41:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjiDvwbj+TBOKu3AC+k1uU3aX8kxDfqiLyVc6TtAAAXkrYYdVtE0oHD3iO/6qdDRGeG//s X-Received: by 2002:a17:906:a3ce:: with SMTP id ca14mr4424594ejb.462.1624372907399; Tue, 22 Jun 2021 07:41:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624372907; cv=none; d=google.com; s=arc-20160816; b=NEtVHumlBrX267CO1MNLogzsYgNNk30sPvDffgFNkwFGlMMFdZS7Z4O2zweOqsetjg 0Iy+CBwHwodMpuV8Xh94OaCxvYMHaIIRfYw9fLr3baSMW8lYH4hlAO+OU89cfuilrtFw 2HBGCRxfOLYVe4qqSaolryaaBaP34DrAQTNADkZoFJZayK3naGoziNxLi/W6C5hcS4xu 2Ad6OMbCUy2JfDc9yGllDGJfy87yDEGdtdD/be2URz141cWjWBXmwQOWa0cDl4ET4jQx rpKefLUR/nY7qvPlLrZwOisQkhfpzJ9CF/YeV5jy1LOG2g84Dp2NcM0m6s08BQ064vv5 eW8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=9xMkEiBqTpXrDIG1ppxVBQbGLQsDzmuXYdb5UGBcKjs=; b=EzB0bek+GoP/aMU5wnea8jRv3WYKJItxTONZyPFKgInqxtwNCJaMGMJdHPMQ+z6PtJ 92syEm4xuVJ7HZWltEnuw6HBUx4cI0tV5rKkHpdnCDZu65i+eVEv9S8PjqyJQGhBzfeT khJLqPBazVwv6pLSHbYyU3WNZs7qeaveTFIW8ej7KQHhutcn13YlrdX7/RDeIyVJH0Xk dVyqHnxR3ZhcMZwGyTPE8x+ExAZx3M38zh6Bo/jf7A962ZnAbFTRg3n5fW2e+Fr3LY6g DoQNIgXjWqZgKATCtudIvT2gm/XvoZX+eBW0UiKVDB6K9cWdxmXgtJ3x49en4Bx9hwmp KS6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 3si14172663ejl.715.2021.06.22.07.41.22; Tue, 22 Jun 2021 07:41:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231849AbhFVOmT (ORCPT + 99 others); Tue, 22 Jun 2021 10:42:19 -0400 Received: from mga01.intel.com ([192.55.52.88]:26400 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230047AbhFVOmS (ORCPT ); Tue, 22 Jun 2021 10:42:18 -0400 IronPort-SDR: +/aXxwOX+E7u/bNUYFvIZ4pzNF/ESvT/wDCARkhRpX1ntbdDVl4LAcohs3THsZ4F/LobBZtSyJ 1Q3r2JudbeRA== X-IronPort-AV: E=McAfee;i="6200,9189,10023"; a="228621337" X-IronPort-AV: E=Sophos;i="5.83,291,1616482800"; d="scan'208";a="228621337" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2021 07:40:02 -0700 IronPort-SDR: emBQV5XIc1/KaJ/O0NcCGaGXgBFS8dFGi9PMnXOuirCNUUetfSCQIAffEdnfX+QSlF9iY6fho8 t+dXuC8ahIwA== X-IronPort-AV: E=Sophos;i="5.83,291,1616482800"; d="scan'208";a="473791317" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2021 07:39:59 -0700 Received: from andy by smile with local (Exim 4.94.2) (envelope-from ) id 1lvhZC-004Uni-Sn; Tue, 22 Jun 2021 17:39:54 +0300 Date: Tue, 22 Jun 2021 17:39:54 +0300 From: Andy Shevchenko To: Jia He Cc: Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Rasmus Villemoes , Jonathan Corbet , Alexander Viro , Linus Torvalds , "Peter Zijlstra (Intel)" , Eric Biggers , "Ahmed S. Darwish" , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Matthew Wilcox , Christoph Hellwig , nd@arm.com Subject: Re: [PATCH v5 2/4] lib/vsprintf.c: make '%pD' print the full path of file Message-ID: References: <20210622140634.2436-1-justin.he@arm.com> <20210622140634.2436-3-justin.he@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210622140634.2436-3-justin.he@arm.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 22, 2021 at 10:06:32PM +0800, Jia He wrote: > Previously, the specifier '%pD' is for printing dentry name of struct > file. It may not be perfect (by default it only prints one component.) > > As suggested by Linus [1]: Citing is better looked when you shift right it by two white spaces. > A dentry has a parent, but at the same time, a dentry really does > inherently have "one name" (and given just the dentry pointers, you > can't show mount-related parenthood, so in many ways the "show just > one name" makes sense for "%pd" in ways it doesn't necessarily for > "%pD"). But while a dentry arguably has that "one primary component", > a _file_ is certainly not exclusively about that last component. > > Hence change the behavior of '%pD' to print the full path of that file. > > Precision is never going to be used with %p (or any of its kernel > extensions) if -Wformat is turned on. > Link: https://lore.kernel.org/lkml/CAHk-=wimsMqGdzik187YWLb-ru+iktb4MYbMQG1rnZ81dXYFVg@mail.gmail.com/ [1] > Shouldn't be blank lines in the tag block. I have an impression that I have commented on this already... ... > -last components. %pD does the same thing for struct file. > +last components. %pD prints full file path together with mount-related I guess you may also convert double space to a single one. > +parenthood. -- With Best Regards, Andy Shevchenko