linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: Xiong Zhou <xzhou@redhat.com>
Cc: trond myklebust <trond.myklebust@primarydata.com>,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] nfs: remove redundant slash from nfs_path
Date: Mon, 25 Aug 2014 14:07:06 -0700	[thread overview]
Message-ID: <1409000826.3033.32.camel@deadeye.wl.decadent.org.uk> (raw)
In-Reply-To: <1859750321.23735105.1408945864304.JavaMail.zimbra@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1053 bytes --]

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.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

  reply	other threads:[~2014-08-25 21:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <600788954.21849581.1408502615727.JavaMail.zimbra@redhat.com>
2014-08-20  3:06 ` [PATCH] nfs: use canonical path in nfs_show_devname Xiong Zhou
2014-08-20 23:10   ` Ben Hutchings
2014-08-25  5:51     ` [PATCH v2] nfs: remove redundant slash from nfs_path Xiong Zhou
2014-08-25 21:07       ` Ben Hutchings [this message]
2014-08-25 21:17         ` Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1409000826.3033.32.camel@deadeye.wl.decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    --cc=xzhou@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).