lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 29 Apr 2021 10:46:30 +0200
From:   Petr Mladek <pmladek@...e.com>
To:     Jia He <justin.he@....com>
Cc:     Linus Torvalds <torvalds@...ux-foundation.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Sergey Senozhatsky <senozhatsky@...omium.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Rasmus Villemoes <linux@...musvillemoes.dk>,
        Jonathan Corbet <corbet@....net>,
        Luca Coelho <luciano.coelho@...el.com>,
        Kalle Valo <kvalo@...eaurora.org>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Heiko Carstens <hca@...ux.ibm.com>,
        Vasily Gorbik <gor@...ux.ibm.com>,
        Christian Borntraeger <borntraeger@...ibm.com>,
        Johannes Berg <johannes.berg@...el.com>,
        linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
        linux-s390@...r.kernel.org
Subject: Re: [PATCH 2/4] lib/vsprintf.c: Make %p{D,d} mean as much components
 as possible

On Wed 2021-04-28 21:59:27, Jia He wrote:
> From: Linus Torvalds <torvalds@...ux-foundation.org>
> 
> We have '%pD'(no digit following) for printing a filename. It may not be
> perfect (by default it only prints one component.
> 
> %pD4 should be more than good enough, but we should make plain "%pD" mean
> "as much of the path that is reasonable" rather than "as few components as
> possible" (ie 1).

Could you please provide link to the discussion where this idea was
came from?

It would be great to add and example into the commit message how
it improved the output.

Also please explain why it is useful/safe to change the behavior
for all existing users. It seems that you checked them and prevented
any regression by the other patches in this patchset.

Anyway, some regressions are fixed by the followup patches.
It would break bisection.

We either need to prevent the regression before this patch.
Or the changes have to be done in this patch. For example,
it would be perfectly fine to update test_printf.c in
this patch.

> Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>

If you want to keep Linus as the author and do more changes, you might
describe here changes done by you, for example:

[justin.he@....com: update documentation and test_printf]
Signed-off-by: Jia He <justin.he@....com>

Or you might make you the author and add

Suggested-by: Linus Torvalds <torvalds@...ux-foundation.org>

> ---
>  Documentation/core-api/printk-formats.rst | 3 ++-
>  lib/vsprintf.c                            | 4 ++--
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/core-api/printk-formats.rst b/Documentation/core-api/printk-formats.rst
> index 9be6de402cb9..aa76cbec0dae 100644
> --- a/Documentation/core-api/printk-formats.rst
> +++ b/Documentation/core-api/printk-formats.rst

Plese, update also the pattern:

-	%pd{,2,3,4}
-	%pD{,2,3,4}
+	%pd{1,2,3,4}
+	%pD{1,2,3,4}

> @@ -413,7 +413,8 @@ dentry names
>  For printing dentry name; if we race with :c:func:`d_move`, the name might
>  be a mix of old and new ones, but it won't oops.  %pd dentry is a safer
>  equivalent of %s dentry->d_name.name we used to use, %pd<n> prints ``n``
> -last components.  %pD does the same thing for struct file.
> +last components.  %pD does the same thing for struct file. By default, %p{D,d}
> +is equal to %p{D,d}4.
>  
>  Passed by reference.

Best Regards,
Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ