Thread (21 messages) 21 messages, 4 authors, 2021-06-24

RE: [PATCH v5 2/4] lib/vsprintf.c: make '%pD' print the full path of file

From: Justin He <hidden>
Date: 2021-06-23 03:15:07
Also in: linux-fsdevel, lkml

Hi Andy
-----Original Message-----
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Sent: Tuesday, June 22, 2021 10:40 PM
To: Justin He <redacted>
Cc: Petr Mladek <pmladek@suse.com>; Steven Rostedt <rostedt@goodmis.org>;
Sergey Senozhatsky [off-list ref]; Rasmus Villemoes
[off-list ref]; Jonathan Corbet [off-list ref]; Alexander
Viro [off-list ref]; Linus Torvalds <torvalds@linux-
foundation.org>; Peter Zijlstra (Intel) [off-list ref]; Eric
Biggers [off-list ref]; Ahmed S. Darwish [off-list ref];
linux-doc@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
fsdevel@vger.kernel.org; Matthew Wilcox [off-list ref]; Christoph
Hellwig [off-list ref]; nd [off-list ref]
Subject: Re: [PATCH v5 2/4] lib/vsprintf.c: make '%pD' print the full path
of file

On Tue, Jun 22, 2021 at 10:06:32PM +0800, Jia He wrote:
quoted
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.
Okay, I plan to cite it with "> "
quoted
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.
quoted
Link: https://lore.kernel.org/lkml/CAHk-=wimsMqGdzik187YWLb-
ru+iktb4MYbMQG1rnZ81dXYFVg@mail.gmail.com/ [1]

quoted
Shouldn't be blank lines in the tag block. I have an impression that I have
commented on this already...
Okay
...
quoted
-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.
Okay

--
Cheers,
Justin (Jia He)

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help