Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4773787pxj; Tue, 22 Jun 2021 07:46:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwH4LNVEzFjiOcLwZ0T8n6D7gbDi3axyp+dA/iXf6a0e8UikDrOoAOnRP/2GKiAAf7lpByA X-Received: by 2002:a17:906:8688:: with SMTP id g8mr4494761ejx.24.1624373186675; Tue, 22 Jun 2021 07:46:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624373186; cv=none; d=google.com; s=arc-20160816; b=nqN+TomHWNu2r67T9xJbrlF3yR7nF2zYzHDyj2kXq1gML+y62UhM/t1d40RART4bvD JZdejeIDE+wcCY77XyWx0rj4iDDEhz3CM66hbJd7rr5b0qDeLEAFbbsk5/kaCb47Hk1X IS4ks0Z61r4SDMwwSSgX4DRC11nOfvox0BaP8ITMg4IFas8wLCCrN1rzfZQ5hfxI7Wut oqlxSK4ptHeGRCZff1ugscbIvT7Pah0uI5ncbtO6b4Gk1apfNoZTnYkWT0VVUa2hd6uq G4MAAyCiuu+9SkJO4dDS1B/aic5beiqX43kgewu43GrZz0zPOfmzEoHGSlEXRuv77ki3 wYUQ== 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=Zngp03PF9DcheetzT5X8U7pSfRqErC8ktXELAOnjNOA=; b=1Idl3XBVxT2FnwiyZn05K8iIzbw5Sh6PbkoXGf+Xnm0UA3jZeiR6P5Fk5wY4Xo+62I Z1dDDGNSNiUA/KNY9VV/lGvZkJbr1JZO2bcqzuj6caRxT6EiHzor4uZSouiMQCLH/RJt TP0dQsPCJa4cwNnUtHP3jnwJ2RWrhPwaMvJVC6Ki7UMWUheHVhK0KrqxtD0eouxlDo0X f0LDlfP3dqFbTaUIjWhGtLqAntYy2iHDRDyni89WqUwKzE/6FXPypFblQ49ZRuTZRaYU kTDI45ln13+k1ZpRY69t2dg7RYHBw2fuGZ6IoGLZIUFfr+TpUk0uYo+6hxNbGMUILEa8 p8Og== 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 m25si14182216ejb.570.2021.06.22.07.46.02; Tue, 22 Jun 2021 07:46:26 -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 S231985AbhFVOpw (ORCPT + 99 others); Tue, 22 Jun 2021 10:45:52 -0400 Received: from mga01.intel.com ([192.55.52.88]:26689 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231348AbhFVOpr (ORCPT ); Tue, 22 Jun 2021 10:45:47 -0400 IronPort-SDR: JvxdboJduOZzcOvkStKygDkllBNviuRSYQYs2L7J8wUnftwG0aghZfhCcBmznTOlhxbN/9D7Tf OTqRmg01B/pg== X-IronPort-AV: E=McAfee;i="6200,9189,10023"; a="228622060" X-IronPort-AV: E=Sophos;i="5.83,291,1616482800"; d="scan'208";a="228622060" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2021 07:43:31 -0700 IronPort-SDR: ie/QTvcNByYrO2GfHoQjFDlUsv+4qABJGxJUy/8WK4lyiMjH25LM187Hlfz9JZ9jBpEeHzGHZo 8D7X+Pe/xuXw== X-IronPort-AV: E=Sophos;i="5.83,291,1616482800"; d="scan'208";a="639126745" 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; 22 Jun 2021 07:43:27 -0700 Received: from andy by smile with local (Exim 4.94.2) (envelope-from ) id 1lvhcZ-004Upi-15; Tue, 22 Jun 2021 17:43:23 +0300 Date: Tue, 22 Jun 2021 17:43:23 +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 0/4] make '%pD' print the full path of file Message-ID: References: <20210622140634.2436-1-justin.he@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210622140634.2436-1-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:30PM +0800, Jia He wrote: > Background > ========== > Linus suggested printing the full path of file instead of printing > the components as '%pd'. > > Typically, there is no need for printk specifiers to take any real locks > (ie mount_lock or rename_lock). So I introduce a new helper d_path_fast > which is similar to d_path except it doesn't take any seqlock/spinlock. > > This series is based on Al Viro's d_path cleanup patches [1] which > lifted the inner lockless loop into a new helper. > > Link: https://lkml.org/lkml/2021/5/18/1260 [1] > > Test > ==== > The cases I tested: > 1. print '%pD' with full path of ext4 file > 2. mount a ext4 filesystem upon a ext4 filesystem, and print the file > with '%pD' > 3. all test_print selftests, including the new '%14pD' '%-14pD' > 4. kasnprintf I believe you are talking about kasprintf(). > Changelog > ========= > v5: > - remove the RFC tag JFYI, when we drop RFC we usually start the series from v1. > - refine the commit msg/comments(by Petr, Andy) > - make using_scratch_space a new parameter of the test case Thanks for the update, I have found few minor things, please address them and feel free to add Reviewed-by: Andy Shevchenko > v4: > - don't support spec.precision anymore for '%pD' > - add Rasmus's patch into this series > > v3: > - implement new d_path_unsafe to use [buf, end] instead of stack space for > filling bytes (by Matthew) > - add new test cases for '%pD' > - drop patch "hmcdrv: remove the redundant directory path" before removing rfc. > > v2: > - implement new d_path_fast based on Al Viro's patches > - add check_pointer check (by Petr) > - change the max full path size to 256 in stack space > > v1: https://lkml.org/lkml/2021/5/8/122 > > > Jia He (3): > fs: introduce helper d_path_unsafe() > lib/vsprintf.c: make '%pD' print the full path of file > lib/test_printf.c: add test cases for '%pD' > > Rasmus Villemoes (1): > lib/test_printf.c: split write-beyond-buffer check in two > > Documentation/core-api/printk-formats.rst | 5 +- > fs/d_path.c | 104 +++++++++++++++++++++- > include/linux/dcache.h | 1 + > lib/test_printf.c | 54 ++++++++--- > lib/vsprintf.c | 40 ++++++++- > 5 files changed, 184 insertions(+), 20 deletions(-) > > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko