[PATCH 4/4] vfs: Call d_dname from dentry_path
Eric W. Biederman
ebiederm at xmission.com
Fri Feb 7 02:24:56 UTC 2014
If the root dentry implements d_dname instead of ignoring it in
__dentry_path call d_dname and return the result.
The motivating example are files under /proc/<pid>/ns/ are bind
mounted into other locations. This change allow the name of the
dentry that is bind mounted to show up in /proc/<pid>/mountinfo.
However in general this is correct behavior any time dentry_path is
called on a dentry that implements d_dname.
Signed-off-by: "Eric W. Biederman" <ebiederm at xmission.com>
---
fs/dcache.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/fs/dcache.c b/fs/dcache.c
index c5c7847ff84b..a7a925fb3ce7 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -3162,6 +3162,8 @@ restart:
done_seqretry(&rename_lock, seq);
if (error)
goto Elong;
+ if (dentry->d_op && dentry->d_op->d_dname)
+ retval = dentry->d_op->d_dname(dentry, buf, len);
return retval;
Elong:
return ERR_PTR(-ENAMETOOLONG);
--
1.7.5.4
More information about the Containers
mailing list