Re: [PATCH RFC 2/3] lib/vsprintf.c: make %pD print full path for file

From: Sergey Senozhatsky
Date: Sun May 09 2021 - 23:46:37 EST


On (21/05/08 20:25), Jia He wrote:
> +++ b/lib/vsprintf.c
> @@ -27,6 +27,7 @@
> #include <linux/string.h>
> #include <linux/ctype.h>
> #include <linux/kernel.h>
> +#include <linux/dcache.h>
> #include <linux/kallsyms.h>
> #include <linux/math64.h>
> #include <linux/uaccess.h>
> @@ -923,10 +924,17 @@ static noinline_for_stack
> char *file_dentry_name(char *buf, char *end, const struct file *f,
> struct printf_spec spec, const char *fmt)
> {
> + const struct path *path = &f->f_path;
> + char *p;
> + char tmp[128];

This doesn't look ideal. Why 128 bytes and why on the stack?