Don't allow invalid 'vers' and 'minorversion' combinations in mount options,
such as "vers=3,minorversion=1".
Signed-off-by: Weston Andros Adamson <[email protected]>
---
fs/nfs/super.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 8e210b2..50baca1 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1519,6 +1519,9 @@ static int nfs_parse_mount_options(char *raw,
if (!sloppy && invalid_option)
return 0;
+ if (mnt->minorversion && mnt->version != 4)
+ goto out_minorversion_mismatch;
+
/*
* verify that any proto=/mountproto= options match the address
* familiies in the addr=/mountaddr= options.
@@ -1552,6 +1555,10 @@ out_invalid_address:
out_invalid_value:
printk(KERN_INFO "NFS: bad mount option value specified: %s\n", p);
return 0;
+out_minorversion_mismatch:
+ printk(KERN_INFO "NFS: mount option vers=%d does not support "
+ "minorversion=%u\n", mnt->version, mnt->minorversion);
+ return 0;
out_nomem:
printk(KERN_INFO "NFS: not enough memory to parse option\n");
return 0;
--
1.7.4.4
On Feb 1, 2012, at 2:46 PM, Myklebust, Trond wrote:
> On Wed, 2012-02-01 at 14:17 -0500, Chuck Lever wrote:
>> Hi-
>>
>> I think we should co-ordinate with Solaris on this administrative interface. Can we discuss in Santa Clara?
>
> Unless they have a strong argument for why this is a bad idea, I plan on
> just adding this to 3.4. There is no point in foot-dragging on this any
> more.
No foot dragging. We just ask at the next convenient opportunity. I think they want to go with vers=41.
>
> Trond
>
>> On Feb 1, 2012, at 2:00 PM, Weston Andros Adamson wrote:
>>
>>>
>>> Signed-off-by: Weston Andros Adamson <[email protected]>
>>> ---
>>> I was already messing around with mountoptions and figured "why not".
>>> It's been joked (?) that 4.1 really should have been NFSv5!
>>>
>>> fs/nfs/super.c | 8 +++++++-
>>> 1 files changed, 7 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
>>> index 50baca1..801b060 100644
>>> --- a/fs/nfs/super.c
>>> +++ b/fs/nfs/super.c
>>> @@ -80,7 +80,7 @@ enum {
>>> Opt_cto, Opt_nocto,
>>> Opt_ac, Opt_noac,
>>> Opt_lock, Opt_nolock,
>>> - Opt_v2, Opt_v3, Opt_v4,
>>> + Opt_v2, Opt_v3, Opt_v4, Opt_v4_1,
>>> Opt_udp, Opt_tcp, Opt_rdma,
>>> Opt_acl, Opt_noacl,
>>> Opt_rdirplus, Opt_nordirplus,
>>> @@ -136,6 +136,7 @@ static const match_table_t nfs_mount_option_tokens = {
>>> { Opt_v2, "v2" },
>>> { Opt_v3, "v3" },
>>> { Opt_v4, "v4" },
>>> + { Opt_v4_1, "v4.1" },
>>> { Opt_udp, "udp" },
>>> { Opt_tcp, "tcp" },
>>> { Opt_rdma, "rdma" },
>>> @@ -1172,6 +1173,11 @@ static int nfs_parse_mount_options(char *raw,
>>> mnt->flags &= ~NFS_MOUNT_VER3;
>>> mnt->version = 4;
>>> break;
>>> + case Opt_v4_1:
>>> + mnt->flags &= ~NFS_MOUNT_VER3;
>>> + mnt->version = 4;
>>> + mnt->minorversion = 1;
>>> + break;
>>> case Opt_udp:
>>> mnt->flags &= ~NFS_MOUNT_TCP;
>>> mnt->nfs_server.protocol = XPRT_TRANSPORT_UDP;
>>> --
>>> 1.7.4.4
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
>>> the body of a message to [email protected]
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
> --
> Trond Myklebust
> Linux NFS client maintainer
>
> NetApp
> [email protected]
> http://www.netapp.com
>
--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
T24gV2VkLCAyMDEyLTAyLTAxIGF0IDE0OjE3IC0wNTAwLCBDaHVjayBMZXZlciB3cm90ZToNCj4g
SGktDQo+IA0KPiBJIHRoaW5rIHdlIHNob3VsZCBjby1vcmRpbmF0ZSB3aXRoIFNvbGFyaXMgb24g
dGhpcyBhZG1pbmlzdHJhdGl2ZSBpbnRlcmZhY2UuICBDYW4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X3Vk
cDoNCj4gPiAJCQltbnQtPmZsYWdzICY9IH5ORlNfTU9VTlRfVENQOw0KPiA+IAkJCW1udC0+bmZz
X3NlcnZlci5wcm90b2NvbCA9IFhQUlRfVFJBTlNQT1JUX1VEUDsNCj4gPiAtLSANCj4gPiAxLjcu
NC40DQo+ID4gDQo+ID4gLS0NCj4gPiBUbyB1bnN1YnNjcmliZSBmcm9tIHRoaXMgbGlzdDogc2Vu
ZCB0aGUgbGluZSAidW5zdWJzY3JpYmUgbGludXgtbmZzIiBpbg0KPiA+IHRoZSBib2R5IG9mIGEg
bWVzc2FnZSB0byBtYWpvcmRvbW9Admdlci5rZXJuZWwub3JnDQo+ID4gTW9yZSBtYWpvcmRvbW8g
aW5mbyBhdCAgaHR0cDovL3ZnZXIua2VybmVsLm9yZy9tYWpvcmRvbW8taW5mby5odG1sDQo+IA0K
DQotLSANClRyb25kIE15a2xlYnVzdA0KTGludXggTkZTIGNsaWVudCBtYWludGFpbmVyDQoNCk5l
dEFwcA0KVHJvbmQuTXlrbGVidXN0QG5ldGFwcC5jb20NCnd3dy5uZXRhcHAuY29tDQoNCg==
On Feb 1, 2012, at 2:59 PM, Myklebust, Trond wrote:
> On Wed, 2012-02-01 at 14:48 -0500, Chuck Lever wrote:
>> On Feb 1, 2012, at 2:46 PM, Myklebust, Trond wrote:
>>
>>> On Wed, 2012-02-01 at 14:17 -0500, Chuck Lever wrote:
>>>> Hi-
>>>>
>>>> I think we should co-ordinate with Solaris on this administrative interface. Can we discuss in Santa Clara?
>>>
>>> Unless they have a strong argument for why this is a bad idea, I plan on
>>> just adding this to 3.4. There is no point in foot-dragging on this any
>>> more.
>>
>> No foot dragging. We just ask at the next convenient opportunity. I think they want to go with vers=41.
>
> "4.1" allows for easier visual and automated parsing of major vs minor
> version. In 8 years from now, I'd prefer to see 'vers=4.10' rather than
> 'vers=410'
Fair enough, and I've made similar points to them in the past. But you should be having this conversation with the Solaris guys, not me. Can we have this discussion at Connectathon, when all interested parties will be in the room? That should still be enough time to allow you to submit this change for 3.4.
(And by the way, you will probably need some adjustment to mount.nfs's string parsing logic as well).
--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
Signed-off-by: Weston Andros Adamson <[email protected]>
---
I was already messing around with mountoptions and figured "why not".
It's been joked (?) that 4.1 really should have been NFSv5!
fs/nfs/super.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 50baca1..801b060 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -80,7 +80,7 @@ enum {
Opt_cto, Opt_nocto,
Opt_ac, Opt_noac,
Opt_lock, Opt_nolock,
- Opt_v2, Opt_v3, Opt_v4,
+ Opt_v2, Opt_v3, Opt_v4, Opt_v4_1,
Opt_udp, Opt_tcp, Opt_rdma,
Opt_acl, Opt_noacl,
Opt_rdirplus, Opt_nordirplus,
@@ -136,6 +136,7 @@ static const match_table_t nfs_mount_option_tokens = {
{ Opt_v2, "v2" },
{ Opt_v3, "v3" },
{ Opt_v4, "v4" },
+ { Opt_v4_1, "v4.1" },
{ Opt_udp, "udp" },
{ Opt_tcp, "tcp" },
{ Opt_rdma, "rdma" },
@@ -1172,6 +1173,11 @@ static int nfs_parse_mount_options(char *raw,
mnt->flags &= ~NFS_MOUNT_VER3;
mnt->version = 4;
break;
+ case Opt_v4_1:
+ mnt->flags &= ~NFS_MOUNT_VER3;
+ mnt->version = 4;
+ mnt->minorversion = 1;
+ break;
case Opt_udp:
mnt->flags &= ~NFS_MOUNT_TCP;
mnt->nfs_server.protocol = XPRT_TRANSPORT_UDP;
--
1.7.4.4
Hi-
I think we should co-ordinate with Solaris on this administrative interface. Can we discuss in Santa Clara?
On Feb 1, 2012, at 2:00 PM, Weston Andros Adamson wrote:
>
> Signed-off-by: Weston Andros Adamson <[email protected]>
> ---
> I was already messing around with mountoptions and figured "why not".
> It's been joked (?) that 4.1 really should have been NFSv5!
>
> fs/nfs/super.c | 8 +++++++-
> 1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
> index 50baca1..801b060 100644
> --- a/fs/nfs/super.c
> +++ b/fs/nfs/super.c
> @@ -80,7 +80,7 @@ enum {
> Opt_cto, Opt_nocto,
> Opt_ac, Opt_noac,
> Opt_lock, Opt_nolock,
> - Opt_v2, Opt_v3, Opt_v4,
> + Opt_v2, Opt_v3, Opt_v4, Opt_v4_1,
> Opt_udp, Opt_tcp, Opt_rdma,
> Opt_acl, Opt_noacl,
> Opt_rdirplus, Opt_nordirplus,
> @@ -136,6 +136,7 @@ static const match_table_t nfs_mount_option_tokens = {
> { Opt_v2, "v2" },
> { Opt_v3, "v3" },
> { Opt_v4, "v4" },
> + { Opt_v4_1, "v4.1" },
> { Opt_udp, "udp" },
> { Opt_tcp, "tcp" },
> { Opt_rdma, "rdma" },
> @@ -1172,6 +1173,11 @@ static int nfs_parse_mount_options(char *raw,
> mnt->flags &= ~NFS_MOUNT_VER3;
> mnt->version = 4;
> break;
> + case Opt_v4_1:
> + mnt->flags &= ~NFS_MOUNT_VER3;
> + mnt->version = 4;
> + mnt->minorversion = 1;
> + break;
> case Opt_udp:
> mnt->flags &= ~NFS_MOUNT_TCP;
> mnt->nfs_server.protocol = XPRT_TRANSPORT_UDP;
> --
> 1.7.4.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
Fine with me.
-dros
On Feb 1, 2012, at 2:17 PM, Chuck Lever wrote:
> Hi-
>
> I think we should co-ordinate with Solaris on this administrative interface. Can we discuss in Santa Clara?
>
> On Feb 1, 2012, at 2:00 PM, Weston Andros Adamson wrote:
>
>>
>> Signed-off-by: Weston Andros Adamson <[email protected]>
>> ---
>> I was already messing around with mountoptions and figured "why not".
>> It's been joked (?) that 4.1 really should have been NFSv5!
>>
>> fs/nfs/super.c | 8 +++++++-
>> 1 files changed, 7 insertions(+), 1 deletions(-)
>>
>> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
>> index 50baca1..801b060 100644
>> --- a/fs/nfs/super.c
>> +++ b/fs/nfs/super.c
>> @@ -80,7 +80,7 @@ enum {
>> Opt_cto, Opt_nocto,
>> Opt_ac, Opt_noac,
>> Opt_lock, Opt_nolock,
>> - Opt_v2, Opt_v3, Opt_v4,
>> + Opt_v2, Opt_v3, Opt_v4, Opt_v4_1,
>> Opt_udp, Opt_tcp, Opt_rdma,
>> Opt_acl, Opt_noacl,
>> Opt_rdirplus, Opt_nordirplus,
>> @@ -136,6 +136,7 @@ static const match_table_t nfs_mount_option_tokens = {
>> { Opt_v2, "v2" },
>> { Opt_v3, "v3" },
>> { Opt_v4, "v4" },
>> + { Opt_v4_1, "v4.1" },
>> { Opt_udp, "udp" },
>> { Opt_tcp, "tcp" },
>> { Opt_rdma, "rdma" },
>> @@ -1172,6 +1173,11 @@ static int nfs_parse_mount_options(char *raw,
>> mnt->flags &= ~NFS_MOUNT_VER3;
>> mnt->version = 4;
>> break;
>> + case Opt_v4_1:
>> + mnt->flags &= ~NFS_MOUNT_VER3;
>> + mnt->version = 4;
>> + mnt->minorversion = 1;
>> + break;
>> case Opt_udp:
>> mnt->flags &= ~NFS_MOUNT_TCP;
>> mnt->nfs_server.protocol = XPRT_TRANSPORT_UDP;
>> --
>> 1.7.4.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
>> the body of a message to [email protected]
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
> --
> Chuck Lever
> chuck[dot]lever[at]oracle[dot]com
>
>
>
>
On Feb 1, 2012, at 3:05 PM, Chuck Lever wrote:
>
> On Feb 1, 2012, at 2:59 PM, Myklebust, Trond wrote:
>
>> On Wed, 2012-02-01 at 14:48 -0500, Chuck Lever wrote:
>>> On Feb 1, 2012, at 2:46 PM, Myklebust, Trond wrote:
>>>
>>>> On Wed, 2012-02-01 at 14:17 -0500, Chuck Lever wrote:
>>>>> Hi-
>>>>>
>>>>> I think we should co-ordinate with Solaris on this administrative interface. Can we discuss in Santa Clara?
>>>>
>>>> Unless they have a strong argument for why this is a bad idea, I plan on
>>>> just adding this to 3.4. There is no point in foot-dragging on this any
>>>> more.
>>>
>>> No foot dragging. We just ask at the next convenient opportunity. I think they want to go with vers=41.
>>
>> "4.1" allows for easier visual and automated parsing of major vs minor
>> version. In 8 years from now, I'd prefer to see 'vers=4.10' rather than
>> 'vers=410'
>
> Fair enough, and I've made similar points to them in the past. But you should be having this conversation with the Solaris guys, not me. Can we have this discussion at Connectathon, when all interested parties will be in the room? That should still be enough time to allow you to submit this change for 3.4.
>
> (And by the way, you will probably need some adjustment to mount.nfs's string parsing logic as well).
Well, it "just worked" for me!
-dros
T24gV2VkLCAyMDEyLTAyLTAxIGF0IDE0OjQ4IC0wNTAwLCBDaHVjayBMZXZlciB3cm90ZToNCj4g
T24gRmViIDEsIDIwMTIsIGF0IDI6NDYgUE0sIE15a2xlYnVzdCwgVHJvbmQgd3JvdGU6DQo+IA0K
PiA+IE9uIFdlZCwgMjAxMi0wMi0wMSBhdCAxNDoxNyAtMDUwMCwgQ2h1Y2sgTGV2ZXIgd3JvdGU6
DQo+ID4+IEhpLQ0KPiA+PiANCj4gPj4gSSB0aGluayB3ZSBzaG91bGQgY28tb3JkaW5hdGUgd2l0
aCBTb2xhcmlzIG9uIHRoaXMgYWRtaW5pc3RyYXRpdmUgaW50ZXJmYWNlLiAgQ2FuIHdlIGRpc2N1
c3MgaW4gU2FudGEgQ2xhcmE/DQo+ID4gDQo+ID4gVW5sZXNzIHRoZXkgaGF2ZSBhIHN0cm9uZyBh
cmd1bWVudCBmb3Igd2h5IHRoaXMgaXMgYSBiYWQgaWRlYSwgSSBwbGFuIG9uDQo+ID4ganVzdCBh
ZGRpbmcgdGhpcyB0byAzLjQuIFRoZXJlIGlzIG5vIHBvaW50IGluIGZvb3QtZHJhZ2dpbmcgb24g
dGh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