diff options
author | Benjamin Coddington <bcodding@redhat.com> | 2016-06-15 15:02:55 -0400 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2016-10-24 12:06:01 -0400 |
commit | 86a6c211d676add579a75b7e172a72bb3e2c21f8 (patch) | |
tree | 7729ab697d720df89323706cf9751d1ed0531ac0 | |
parent | 83aa3e0f791d458a28f91d7a50f92926f971ef7c (diff) |
NFS: Trim extra slash in v4 nfs_path
A NFSv4 mount of a subdirectory will show an extra slash (as in
'server://path') in proc's mountinfo which will not match the device name
and path. This can cause problems for programs searching for the mount.
Fix this by checking for a leading slash in the dentry path, if so trim
away any trailing slashes in the device name.
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
-rw-r--r-- | fs/nfs/namespace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c index c8162c660c44..5551e8ef67fd 100644 --- a/fs/nfs/namespace.c +++ b/fs/nfs/namespace.c | |||
@@ -98,7 +98,7 @@ rename_retry: | |||
98 | return end; | 98 | return end; |
99 | } | 99 | } |
100 | namelen = strlen(base); | 100 | namelen = strlen(base); |
101 | if (flags & NFS_PATH_CANONICAL) { | 101 | if (*end == '/') { |
102 | /* Strip off excess slashes in base string */ | 102 | /* Strip off excess slashes in base string */ |
103 | while (namelen > 0 && base[namelen - 1] == '/') | 103 | while (namelen > 0 && base[namelen - 1] == '/') |
104 | namelen--; | 104 | namelen--; |