lkml.org 
[lkml]   [2014]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] nfs: remove redundant slash from nfs_path
From
Date
On Mon, 2014-08-25 at 01:51 -0400, Xiong Zhou wrote:
> When export root dir(/) via nfs, and mount a particular dir under root, eg
> /nfsexport, there will be defect double slash output in /proc/mounts, like
> localhost://nfsexport. While this patch change it to localhost:/nfsexport.
>
> Signed-off-by: Xiong Zhou <xzhou@redhat.com>
> ---
> fs/nfs/namespace.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c
> index b5a0afc..24f954e 100644
> --- a/fs/nfs/namespace.c
> +++ b/fs/nfs/namespace.c
> @@ -98,7 +98,7 @@ rename_retry:
> return end;
> }
> namelen = strlen(base);
> - if (flags & NFS_PATH_CANONICAL) {
> + if ((flags & NFS_PATH_CANONICAL) || *end == '/') {
> /* Strip off excess slashes in base string */
> while (namelen > 0 && base[namelen - 1] == '/')
> namelen--;

I think this makes sense, though I'm not sure I completely understand
this function. :-/

Ben.

--
Ben Hutchings
All extremists should be taken out and shot.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2014-08-25 23:21    [W:0.135 / U:0.976 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site