[PATCH 4/4] vfs: Call d_dname from dentry_path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux