[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1265064326.25140.398.camel@Joe-Laptop.home>
Date: Mon, 01 Feb 2010 14:45:26 -0800
From: Joe Perches <joe@...ches.com>
To: Al Viro <viro@...IV.linux.org.uk>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH][RFC] %pd - for printing dentry name
On Mon, 2010-02-01 at 22:25 +0000, Al Viro wrote:
> There's a lot of places doing printks with ->d_name of various
> dentries. Unfortunately, as often as not they are b0rken due to races
> with rename().
>
> I propose to add a new format - %pd. It would print dentry name.
> However, unlike everything else in vsnprintf, it would NOT be locking-agnostic.
> It would grab and release dentry->d_lock. And yes, I hate that as much as
> anyone. I don't see any sane alternative.
[]
> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
> index 3b8aeec..52a09dc 100644
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -880,6 +880,18 @@ static char *uuid_string(char *buf, char *end, const u8 *addr,
> return string(buf, end, uuid, spec);
> }
>
> +static char *dname_string(char *buf, char *end, struct dentry *d,
> + struct printf_spec spec)
Maybe there's value in passing fmt here to allow
printing of the various dentry fields?
"%pd<foo>"
for things like:
pr_debug("ds_read(socket %d)\n", iminor(file->f_path.dentry->d_inode));
dprintk("%s: dentry = %s/%s, cookie = %Lu\n", __func__,
dentry->d_parent->d_name.name,
dentry->d_name.name,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists