linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] mount.nfs: strip of extra slashes in device name
@ 2012-03-02 16:53 Steve Dickson
  2012-03-02 18:45 ` Malahal Naineni
  0 siblings, 1 reply; 5+ messages in thread
From: Steve Dickson @ 2012-03-02 16:53 UTC (permalink / raw)
  To: Linux NFS Mailing list

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] mount.nfs: strip of extra slashes in device name
  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
  2012-03-02 19:16   ` Steve Dickson
  0 siblings, 1 reply; 5+ messages in thread
From: Malahal Naineni @ 2012-03-02 18:45 UTC (permalink / raw)
  To: Linux NFS Mailing list

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
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] mount.nfs: strip of extra slashes in device name
  2012-03-02 18:45 ` Malahal Naineni
@ 2012-03-02 19:16   ` Steve Dickson
  2012-03-02 19:46     ` Malahal Naineni
  0 siblings, 1 reply; 5+ messages in thread
From: Steve Dickson @ 2012-03-02 19:16 UTC (permalink / raw)
  To: Linux NFS Mailing list



On 03/02/2012 01:45 PM, Malahal Naineni wrote:
> My kernel doesn't seem to strip '/' from its /proc/mounts. What kernel
> are you using? 
a later RHEL6 kernel... but I see the same thing with Fedora f16 kernels (3.2)
as well... 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
I made a comment on that... Again, sorry for my tartness...

steved.
 
> 
> 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
>>
> 
> --
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] mount.nfs: strip of extra slashes in device name
  2012-03-02 19:16   ` Steve Dickson
@ 2012-03-02 19:46     ` Malahal Naineni
  2012-03-02 21:50       ` Malahal Naineni
  0 siblings, 1 reply; 5+ messages in thread
From: Malahal Naineni @ 2012-03-02 19:46 UTC (permalink / raw)
  To: Linux NFS Mailing list

Steve Dickson [SteveD@redhat.com] wrote:
> 
> 
> On 03/02/2012 01:45 PM, Malahal Naineni wrote:
> > My kernel doesn't seem to strip '/' from its /proc/mounts. What kernel
> > are you using? 
> a later RHEL6 kernel... but I see the same thing with Fedora f16 kernels (3.2)
> as well... What kernel are you using?

Using 3.3.0-rc1+ kernel.
[root@elm3c105 ~]# grep mnt /proc/mounts 
elm3c104:///server/ /mnt nfs rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=9.47.69.104,mountvers=3,mountport=929,mountproto=udp,local_lock=none,addr=9.47.69.104 0 0

I must be missing something, I see the same thing in RHEL6.2 version of
Linux.

Regards, Malahal.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] mount.nfs: strip of extra slashes in device name
  2012-03-02 19:46     ` Malahal Naineni
@ 2012-03-02 21:50       ` Malahal Naineni
  0 siblings, 0 replies; 5+ messages in thread
From: Malahal Naineni @ 2012-03-02 21:50 UTC (permalink / raw)
  To: Linux NFS Mailing list

Malahal Naineni [malahal@us.ibm.com] wrote:
> > as well... What kernel are you using?
> 
> Using 3.3.0-rc1+ kernel.
> [root@elm3c105 ~]# grep mnt /proc/mounts 
> elm3c104:///server/ /mnt nfs rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=9.47.69.104,mountvers=3,mountport=929,mountproto=udp,local_lock=none,addr=9.47.69.104 0 0
> 
> I must be missing something, I see the same thing in RHEL6.2 version of
> Linux.

I rebooted my server with an older distro and you can see above that it
is mounting NFSv3. Sorry, my bad. Kernel does strip extra leading '/'s
when I mount NFSv4.

Regards, Malahal.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-02 21:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2012-03-02 19:16   ` Steve Dickson
2012-03-02 19:46     ` Malahal Naineni
2012-03-02 21:50       ` Malahal Naineni

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).