* [PATCH] mount: Writes signal number to kernel as command line
@ 2015-04-13 12:11 Kinglong Mee
2015-04-13 12:53 ` Benjamin Coddington
2015-05-07 14:14 ` Steve Dickson
0 siblings, 2 replies; 4+ messages in thread
From: Kinglong Mee @ 2015-04-13 12:11 UTC (permalink / raw)
To: Steve Dickson; +Cc: bcodding, linux-nfs@vger.kernel.org, kinglongmee
When mounting nfs with -overs=4,minorversion=2, want getting
nfs mounts with vers=4.2, but got vers=4.0 as,
# mount -t nfs -onfsvers=4,minorversion=2 127.0.0.1:/ /mnt/
# cat /proc/mounts | grep vers
127.0.0.1:/ /mnt nfs4 rw,relatime,vers=4.0,rsize=262144,wsize=262144,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=127.0.0.1,local_lock=none,addr=127.0.0.1 0 0
It's caused by mount.nfs writing bad vers to kernel. This patch
lets mount.nfs writing signal number to kernel as command line.
Note: This patch is based on my last patch,
"mount: make sure mounting nfs with v4,vers=4 and nfsvers=4"
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
utils/mount/stropts.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index 2ae532e..c8f5a6d 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -737,8 +737,13 @@ static int nfs_do_mount_v4(struct nfsmount_info *mi,
}
if (mi->version.v_mode != V_SPECIFIC) {
- snprintf(version_opt, sizeof(version_opt) - 1,
- "vers=%lu.%lu", mi->version.major, mi->version.minor);
+ if (mi->version.v_mode == V_GENERAL)
+ snprintf(version_opt, sizeof(version_opt) - 1,
+ "vers=%lu", mi->version.major);
+ else
+ snprintf(version_opt, sizeof(version_opt) - 1,
+ "vers=%lu.%lu", mi->version.major,
+ mi->version.minor);
if (po_append(options, version_opt) == PO_FAILED) {
errno = EINVAL;
--
2.3.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mount: Writes signal number to kernel as command line
2015-04-13 12:11 [PATCH] mount: Writes signal number to kernel as command line Kinglong Mee
@ 2015-04-13 12:53 ` Benjamin Coddington
2015-05-06 13:37 ` Kinglong Mee
2015-05-07 14:14 ` Steve Dickson
1 sibling, 1 reply; 4+ messages in thread
From: Benjamin Coddington @ 2015-04-13 12:53 UTC (permalink / raw)
To: Kinglong Mee; +Cc: Steve Dickson, linux-nfs@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 1862 bytes --]
On Mon, 13 Apr 2015, Kinglong Mee wrote:
> When mounting nfs with -overs=4,minorversion=2, want getting
> nfs mounts with vers=4.2, but got vers=4.0 as,
>
> # mount -t nfs -onfsvers=4,minorversion=2 127.0.0.1:/ /mnt/
> # cat /proc/mounts | grep vers
> 127.0.0.1:/ /mnt nfs4 rw,relatime,vers=4.0,rsize=262144,wsize=262144,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=127.0.0.1,local_lock=none,addr=127.0.0.1 0 0
>
> It's caused by mount.nfs writing bad vers to kernel. This patch
> lets mount.nfs writing signal number to kernel as command line.
>
> Note: This patch is based on my last patch,
> "mount: make sure mounting nfs with v4,vers=4 and nfsvers=4"
>
> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Looks good.
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
> ---
> utils/mount/stropts.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
> index 2ae532e..c8f5a6d 100644
> --- a/utils/mount/stropts.c
> +++ b/utils/mount/stropts.c
> @@ -737,8 +737,13 @@ static int nfs_do_mount_v4(struct nfsmount_info *mi,
> }
>
> if (mi->version.v_mode != V_SPECIFIC) {
> - snprintf(version_opt, sizeof(version_opt) - 1,
> - "vers=%lu.%lu", mi->version.major, mi->version.minor);
> + if (mi->version.v_mode == V_GENERAL)
> + snprintf(version_opt, sizeof(version_opt) - 1,
> + "vers=%lu", mi->version.major);
> + else
> + snprintf(version_opt, sizeof(version_opt) - 1,
> + "vers=%lu.%lu", mi->version.major,
> + mi->version.minor);
>
> if (po_append(options, version_opt) == PO_FAILED) {
> errno = EINVAL;
> --
> 2.3.5
>
> --
> 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] 4+ messages in thread
* Re: [PATCH] mount: Writes signal number to kernel as command line
2015-04-13 12:53 ` Benjamin Coddington
@ 2015-05-06 13:37 ` Kinglong Mee
0 siblings, 0 replies; 4+ messages in thread
From: Kinglong Mee @ 2015-05-06 13:37 UTC (permalink / raw)
To: Steve Dickson; +Cc: Benjamin Coddington, linux-nfs@vger.kernel.org
On 4/13/2015 8:53 PM, Benjamin Coddington wrote:
> On Mon, 13 Apr 2015, Kinglong Mee wrote:
>
>> When mounting nfs with -overs=4,minorversion=2, want getting
>> nfs mounts with vers=4.2, but got vers=4.0 as,
>>
>> # mount -t nfs -onfsvers=4,minorversion=2 127.0.0.1:/ /mnt/
>> # cat /proc/mounts | grep vers
>> 127.0.0.1:/ /mnt nfs4 rw,relatime,vers=4.0,rsize=262144,wsize=262144,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=127.0.0.1,local_lock=none,addr=127.0.0.1 0 0
>>
>> It's caused by mount.nfs writing bad vers to kernel. This patch
>> lets mount.nfs writing signal number to kernel as command line.
>>
>> Note: This patch is based on my last patch,
>> "mount: make sure mounting nfs with v4,vers=4 and nfsvers=4"
>>
>> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
>
> Looks good.
>
> Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Add this one?
thanks,
Kinglong Mee
>> ---
>> utils/mount/stropts.c | 9 +++++++--
>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
>> index 2ae532e..c8f5a6d 100644
>> --- a/utils/mount/stropts.c
>> +++ b/utils/mount/stropts.c
>> @@ -737,8 +737,13 @@ static int nfs_do_mount_v4(struct nfsmount_info *mi,
>> }
>>
>> if (mi->version.v_mode != V_SPECIFIC) {
>> - snprintf(version_opt, sizeof(version_opt) - 1,
>> - "vers=%lu.%lu", mi->version.major, mi->version.minor);
>> + if (mi->version.v_mode == V_GENERAL)
>> + snprintf(version_opt, sizeof(version_opt) - 1,
>> + "vers=%lu", mi->version.major);
>> + else
>> + snprintf(version_opt, sizeof(version_opt) - 1,
>> + "vers=%lu.%lu", mi->version.major,
>> + mi->version.minor);
>>
>> if (po_append(options, version_opt) == PO_FAILED) {
>> errno = EINVAL;
>> --
>> 2.3.5
>>
>> --
>> 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] 4+ messages in thread
* Re: [PATCH] mount: Writes signal number to kernel as command line
2015-04-13 12:11 [PATCH] mount: Writes signal number to kernel as command line Kinglong Mee
2015-04-13 12:53 ` Benjamin Coddington
@ 2015-05-07 14:14 ` Steve Dickson
1 sibling, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2015-05-07 14:14 UTC (permalink / raw)
To: Kinglong Mee; +Cc: bcodding, linux-nfs@vger.kernel.org
On 04/13/2015 08:11 AM, Kinglong Mee wrote:
> When mounting nfs with -overs=4,minorversion=2, want getting
> nfs mounts with vers=4.2, but got vers=4.0 as,
>
> # mount -t nfs -onfsvers=4,minorversion=2 127.0.0.1:/ /mnt/
> # cat /proc/mounts | grep vers
> 127.0.0.1:/ /mnt nfs4 rw,relatime,vers=4.0,rsize=262144,wsize=262144,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=127.0.0.1,local_lock=none,addr=127.0.0.1 0 0
>
> It's caused by mount.nfs writing bad vers to kernel. This patch
> lets mount.nfs writing signal number to kernel as command line.
>
> Note: This patch is based on my last patch,
> "mount: make sure mounting nfs with v4,vers=4 and nfsvers=4"
>
> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Committed...
steved.
> ---
> utils/mount/stropts.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
> index 2ae532e..c8f5a6d 100644
> --- a/utils/mount/stropts.c
> +++ b/utils/mount/stropts.c
> @@ -737,8 +737,13 @@ static int nfs_do_mount_v4(struct nfsmount_info *mi,
> }
>
> if (mi->version.v_mode != V_SPECIFIC) {
> - snprintf(version_opt, sizeof(version_opt) - 1,
> - "vers=%lu.%lu", mi->version.major, mi->version.minor);
> + if (mi->version.v_mode == V_GENERAL)
> + snprintf(version_opt, sizeof(version_opt) - 1,
> + "vers=%lu", mi->version.major);
> + else
> + snprintf(version_opt, sizeof(version_opt) - 1,
> + "vers=%lu.%lu", mi->version.major,
> + mi->version.minor);
>
> if (po_append(options, version_opt) == PO_FAILED) {
> errno = EINVAL;
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-05-07 14:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-13 12:11 [PATCH] mount: Writes signal number to kernel as command line Kinglong Mee
2015-04-13 12:53 ` Benjamin Coddington
2015-05-06 13:37 ` Kinglong Mee
2015-05-07 14:14 ` Steve Dickson
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).