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=-13.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 60502C2B9F4 for ; Tue, 22 Jun 2021 14:43:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4960960241 for ; Tue, 22 Jun 2021 14:43:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232011AbhFVOp4 (ORCPT ); Tue, 22 Jun 2021 10:45:56 -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