diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/dcache.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 4bdb300b16e2..f7282ebf1a37 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -3061,8 +3061,13 @@ char *d_path(const struct path *path, char *buf, int buflen) | |||
3061 | * thus don't need to be hashed. They also don't need a name until a | 3061 | * thus don't need to be hashed. They also don't need a name until a |
3062 | * user wants to identify the object in /proc/pid/fd/. The little hack | 3062 | * user wants to identify the object in /proc/pid/fd/. The little hack |
3063 | * below allows us to generate a name for these objects on demand: | 3063 | * below allows us to generate a name for these objects on demand: |
3064 | * | ||
3065 | * Some pseudo inodes are mountable. When they are mounted | ||
3066 | * path->dentry == path->mnt->mnt_root. In that case don't call d_dname | ||
3067 | * and instead have d_path return the mounted path. | ||
3064 | */ | 3068 | */ |
3065 | if (path->dentry->d_op && path->dentry->d_op->d_dname) | 3069 | if (path->dentry->d_op && path->dentry->d_op->d_dname && |
3070 | (!IS_ROOT(path->dentry) || path->dentry != path->mnt->mnt_root)) | ||
3066 | return path->dentry->d_op->d_dname(path->dentry, buf, buflen); | 3071 | return path->dentry->d_op->d_dname(path->dentry, buf, buflen); |
3067 | 3072 | ||
3068 | rcu_read_lock(); | 3073 | rcu_read_lock(); |