All of lore.kernel.org
 help / color / mirror / Atom feed
From: Malahal Naineni <malahal@us.ibm.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 1/1] mount.nfs: strip of extra slashes in device name
Date: Fri, 2 Mar 2012 12:45:56 -0600	[thread overview]
Message-ID: <20120302184556.GA6880@us.ibm.com> (raw)
In-Reply-To: <1330707221-4005-1-git-send-email-steved@redhat.com>

My kernel doesn't seem to strip '/' from its /proc/mounts. What kernel
are you using? Anyway, how about something similar to the following
patch that fixes only NFSv4 atm:

http://www.spinics.net/lists/linux-nfs/msg27351.html

Regards, Malahal.

Steve Dickson [steved@redhat.com] wrote:
> The kernel strips off extra '/' when the  device is entered
> into /proc/mounts. So that umounts can this devices, strip off
> any extra '/' before storing the device in the mtab.
> 
> Signed-off-by: Steve Dickson <steved@redhat.com>
> ---
>  utils/mount/mount.c |   18 ++++++++++++++++++
>  1 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/utils/mount/mount.c b/utils/mount/mount.c
> index eea00af..eb63f50 100644
> --- a/utils/mount/mount.c
> +++ b/utils/mount/mount.c
> @@ -485,6 +485,24 @@ int main(int argc, char *argv[])
>  		goto out;
>  	}
>  	/*
> +	 * The kernel strips off extra '/' when the device is entered 
> +	 * into /proc/mounts. So that umounts can this devices, strip off
> +	 * any extra '/' before storing the device in the mtab.
> +	 */
> +	if (strstr(spec, "//") != NULL) {
> +		char *colen, *slash;
> +
> +		if ((colen = strchr(spec, ':'))) {
> +			slash = (colen + 1);
> +			while (*slash && *(slash+1) == '/')
> +				slash++;
> +			while (*slash)
> +				*(++colen) = *(slash++);
> +			*(colen+1) = '\0';
> +		}
> +	}
> +
> +	/*
>  	 * Concatenate mount options from the configuration file
>  	 */
>  	mount_opts = mount_config_opts(spec, mount_point, mount_opts);
> -- 
> 1.7.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


  reply	other threads:[~2012-03-02 18:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02 16:53 [PATCH 1/1] mount.nfs: strip of extra slashes in device name Steve Dickson
2012-03-02 18:45 ` Malahal Naineni [this message]
2012-03-02 19:16   ` Steve Dickson
2012-03-02 19:46     ` Malahal Naineni
2012-03-02 21:50       ` Malahal Naineni

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=20120302184556.GA6880@us.ibm.com \
    --to=malahal@us.ibm.com \
    --cc=linux-nfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.