[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wjzBbEdpteXfRp6-WPKkZBZ1dtJSir0YqSKb_qi8AghuQ@mail.gmail.com>
Date: Fri, 30 Apr 2021 11:58:32 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: Justin He <Justin.He@....com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Christoph Hellwig <hch@....de>,
"Darrick J. Wong" <djwong@...nel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
linux-xfs <linux-xfs@...r.kernel.org>,
Dave Chinner <david@...morbit.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Eric Sandeen <sandeen@...deen.net>,
Andy Shevchenko <andy.shevchenko@...il.com>
Subject: Re: [GIT PULL] iomap: new code for 5.13-rc1
On Thu, Apr 29, 2021 at 8:21 PM Al Viro <viro@...iv.linux.org.uk> wrote:
>
> Just what does vfsmount have to do with rename_lock? And what's the point
> of the entire mess, anyway?
Currently "%pD" doesn't actually show a truly valid pathname.
So we have three cases:
(a) __d_path and friends get the name right, but are being overly
careful about it, and take mount_lock and rename_lock in prepend_path
(b) dentry_path() doesn't get the actual path name right (only the
in-filesystem one), and takes rename_lock in __dentry_path
(c) for the vsnprintf case, dentry_name() is the nice lockless "good
for debugging and printk" that doesn't take any locks at all, and
optimistically gives a valid end result, even if it's perhaps not
*THE* valid end result
Basically, the vsnprintf case does the right thing for dentries, and
the whole "you can use this for debugging messages even when you hold
the rename lock" etc.
So (c) is the "debug messages version of (b)".
But there is no "debug messages version of (a)", which is what would
be good for %pD.
You can see it in how the s390 hmcdriv thing does that
pr_debug("open file '/dev/%pD' with return code %d\n", fp, rc);
which is really just garbage: the "/dev/" part is just a guess, but
yes, if /dev is devtmpfs - like it usually is - then '%pD' simply
doesn't do the right thing (even if it had '%pD2')
Linus
Powered by blists - more mailing lists