NFS: Only warn on unrecognized mount options
Subsystems (2)
PATCH 1/1 NFS: Only warn on unrecognized mount options
To provide compatibility with automounters who use a common set of mount options for all file systems, change the NFS in-kernel mount option parser to ignore mount options it doesn't recognize.
---
Yet another NFS mount patch! Build tested only. Comments?
fs/nfs/super.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)
fs/nfs/super.c +2 -5
@@ -1044,7 +1044,8 @@ static int nfs_parse_mount_options(char *raw,break ;default : - goto out_unknown; +printk (KERN_INFO "NFS: unrecognized mount option '%s'" +" ignored\n" , p); } }
@@ -1070,10 +1071,6 @@ out_unrec_xprt: out_unrec_sec:printk (KERN_INFO "NFS: unrecognized security flavor\n" );return 0 ; - -out_unknown: -printk (KERN_INFO "NFS: unknown mount option: %s\n" , p); -return 0 ; }/*
Quoted 26 lines · Chuck Lever
To provide compatibility with automounters who use a common set of mount options for all file systems, change the NFS in-kernel mount option parser to ignore mount options it doesn't recognize.
Signed-off-by Chuck Lever <[email protected]>---
Yet another NFS mount patch! Build tested only. Comments?fs/nfs/super.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)fs/nfs/super.c +2
-1@@ -1044,7 +1044,8 @@ static int nfs_parse_mount_options(char *raw,break ;default : - goto out_unknown; +printk (KERN_INFO "NFS: unrecognized mount option '%s'" +" ignored\n" , p); } }
fs/nfs/super.c out_unrec_xprt: · line 1076
Quoted 10 lines
fs/nfs/super.c +0
-4@@ -1070,10 +1071,6 @@ out_unrec_xprt: out_unrec_sec:printk (KERN_INFO "NFS: unrecognized security flavor\n" );return 0 ; - -out_unknown: -printk (KERN_INFO "NFS: unknown mount option: %s\n" , p); -return 0 ; }/*
This will potentially cause a very large number of messages to be printed in a valid deployment. Do we really need the message?
ps
Quoted 36 lines · Peter Staubach
Quoted 35 lines · Chuck Lever
To provide compatibility with automounters who use a common set of mount options for all file systems, change the NFS in-kernel mount option parser to ignore mount options it doesn't recognize.
Signed-off-by Chuck Lever <[email protected]>---
Yet another NFS mount patch! Build tested only. Comments?fs/nfs/super.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)fs/nfs/super.c +2
-5@@ -1044,7 +1044,8 @@ static int nfs_parse_mount_options(char *raw,break ;default : - goto out_unknown; +printk (KERN_INFO "NFS: unrecognized mount option '%s'" +" ignored\n" , p); } }@@ -1070,10 +1071,6 @@ out_unrec_xprt: out_unrec_sec:printk (KERN_INFO "NFS: unrecognized security flavor\n" );return 0 ; - -out_unknown: -printk (KERN_INFO "NFS: unknown mount option: %s\n" , p); -return 0 ; }
Quoted 4 lines
fs/nfs/super.c out_unrec_xprt: · line 1076
Quoted 1 line
fs/nfs/super.c +0
-0/* This will potentially cause a very large number of messages to be printed in a valid deployment. Do we really need the message?
I was wondering about that.
I left it in because it's useful to know when a valid mount option is misspelled. In that case it might cause an important option (such as "noac") to be ignored.
begin:vcard
fn:Chuck Lever
n:Lever;Chuck
org:Oracle Corporation;Corporate Architecture: Linux Projects Group adr:;;1015 Granger Avenue;Ann Arbor;MI;48104;USA title:Principal Member of Staff
tel;work:+1 248 614 5091
x-mozilla-html:FALSE
version:2.1
end:vcard
Quoted 37 lines · Chuck Lever
Quoted 36 lines · Peter Staubach
Quoted 35 lines · Chuck Lever
To provide compatibility with automounters who use a common set of mount options for all file systems, change the NFS in-kernel mount option parser to ignore mount options it doesn't recognize.
Signed-off-by Chuck Lever <[email protected]>---
Yet another NFS mount patch! Build tested only. Comments?fs/nfs/super.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)fs/nfs/super.c +2
-5@@ -1044,7 +1044,8 @@ static int nfs_parse_mount_options(char *raw,break ;default : - goto out_unknown; +printk (KERN_INFO "NFS: unrecognized mount option '%s'" +" ignored\n" , p); } }@@ -1070,10 +1071,6 @@ out_unrec_xprt: out_unrec_sec:printk (KERN_INFO "NFS: unrecognized security flavor\n" );return 0 ; - -out_unknown: -printk (KERN_INFO "NFS: unknown mount option: %s\n" , p); -return 0 ; }
Quoted 8 lines
Quoted 4 lines
fs/nfs/super.c out_unrec_xprt: · line 1076
Quoted 1 line
fs/nfs/super.c +0
-0/* This will potentially cause a very large number of messages to be printed in a valid deployment. Do we really need the message?
I was wondering about that.
I left it in because it's useful to know when a valid mount option is misspelled. In that case it might cause an important option (such as "noac") to be ignored.
There do seem to be valid uses for the message. However, it could also end up being a bad thing.
Perhaps we could just gather the unknown options and lump them together in something that would be visible via /proc/mounts or some such. Something like "unknown=..." in the options list.
ps
Quoted 26 lines · Chuck Lever
To provide compatibility with automounters who use a common set of mount options for all file systems, change the NFS in-kernel mount option parser to ignore mount options it doesn't recognize.
Signed-off-by Chuck Lever <[email protected]>---
Yet another NFS mount patch! Build tested only. Comments?fs/nfs/super.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)fs/nfs/super.c +2
-1@@ -1044,7 +1044,8 @@ static int nfs_parse_mount_options(char *raw,break ;default : - goto out_unknown; +printk (KERN_INFO "NFS: unrecognized mount option '%s'" +" ignored\n" , p); } }
fs/nfs/super.c out_unrec_xprt: · line 1076
Quoted 10 lines
fs/nfs/super.c +0
-4@@ -1070,10 +1071,6 @@ out_unrec_xprt: out_unrec_sec:printk (KERN_INFO "NFS: unrecognized security flavor\n" );return 0 ; - -out_unknown: -printk (KERN_INFO "NFS: unknown mount option: %s\n" , p); -return 0 ; }/*
This isn't really a very good solution either. Spamming the syslog on every option that is being ignored isn't going to help the folks with the global automounter maps. Either the rules should be that 'all options are allowed' or they should be that 'only recognised NFS options are allowed'.
Signature · 6 lines
Trond Myklebust Linux NFS client maintainer NetApp [email protected] www.netapp.com
Quoted 36 lines · Trond Myklebust
Quoted 35 lines · Chuck Lever
To provide compatibility with automounters who use a common set of mount options for all file systems, change the NFS in-kernel mount option parser to ignore mount options it doesn't recognize.
Signed-off-by Chuck Lever <[email protected]>---
Yet another NFS mount patch! Build tested only. Comments?
fs/nfs/super.c| 7 ++-----1 files changed, 2 insertions(+), 5 deletions(-)fs/nfs/super.c +2
-1@@ -1044,7 +1044,8 @@ static int nfs_parse_mount_options(char *raw,break ;default : - goto out_unknown; +printk (KERN_INFO "NFS: unrecognized mount option '%s'" +" ignored\n" , p); } }@@ -1070,10 +1071,6 @@ out_unrec_xprt:
out_unrec_sec:printk(KERN_INFO "NFS: unrecognized security flavor\n"); return 0;fs/nfs/super.c +0
-4- -out_unknown: -printk (KERN_INFO "NFS: unknown mount option: %s\n" , p); -return 0 ;}
Quoted 7 lines
Quoted 1 line
/*
This isn't really a very good solution either. Spamming the syslog on every option that is being ignored isn't going to help the folks with the global automounter maps. Either the rules should be that 'all options are allowed' or they should be that 'only recognised NFS options are allowed'.
Despite what I posted last week, I like the code the way it is now: We should reject any unrecognized mount options with an error message. Anything else invites subtle behavior problems, security holes, or even the possibility of data corruption.
Oracle databases, for example, do rely on "sync" mounts actually being synchronous. If you specify Kerberos security but misspell it, I think you would want to know that you're not getting the security level you expect.
Can someone (maybe Peter) help me understand how exactly this makes using an automounter problematic?
Thanks!
--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
Quoted 46 lines · Chuck Lever
Quoted 36 lines · Trond Myklebust
Quoted 35 lines · Chuck Lever
To provide compatibility with automounters who use a common set of mount options for all file systems, change the NFS in-kernel mount option parser to ignore mount options it doesn't recognize.
Signed-off-by Chuck Lever <[email protected]>---
Yet another NFS mount patch! Build tested only. Comments?
fs/nfs/super.c| 7 ++-----1 files changed, 2 insertions(+), 5 deletions(-)fs/nfs/super.c +2
-1@@ -1044,7 +1044,8 @@ static int nfs_parse_mount_options(char *raw,break ;default : - goto out_unknown; +printk (KERN_INFO "NFS: unrecognized mount option '%s'" +" ignored\n" , p); } }@@ -1070,10 +1071,6 @@ out_unrec_xprt:
out_unrec_sec:printk(KERN_INFO "NFS: unrecognized security flavor\n"); return 0;fs/nfs/super.c +0
-4- -out_unknown: -printk (KERN_INFO "NFS: unknown mount option: %s\n" , p); -return 0 ;}
Quoted 7 lines
Quoted 1 line
/*
This isn't really a very good solution either. Spamming the syslog on every option that is being ignored isn't going to help the folks with the global automounter maps. Either the rules should be that 'all options are allowed' or they should be that 'only recognised NFS options are allowed'.
Quoted 5 lines
Despite what I posted last week, I like the code the way it is now: We should reject any unrecognized mount options with an error message. Anything else invites subtle behavior problems, security holes, or even the possibility of data corruption.
Oracle databases, for example, do rely on "sync" mounts actually being synchronous. If you specify Kerberos security but misspell it, I think you would want to know that you're not getting the security level you expect.
Can someone (maybe Peter) help me understand how exactly this makes using an automounter problematic?
Automounter tools like autofs tend to get their mount options from global maps, stored in name or directory services like NIS or LDAP. Many users will be running mixed environment networks, including systems like Solaris, HP/UX, AIX, Linux, etc. This means that the automounter maps may include options which only make sense for specific systems and aren't applicable to other systems.
One of the features of an automounting feature, other than the centralized administration, which may or may not be a liability in this situation, is dynamic mounting and umounting. This keeps unused file systems from causing a problem because they get umounted and then less likely for an application to stumble into and hence, keeping a dead or very slow server from causing needless delays and problems. This also means that the same file system may get mounted and umounted many times during day.
If the kernel is to print a message every time that it sees an option that it doesn't understand, than it is possible that many, many messages could be printed, one for _each_ unknown option _every time_ that the file system is mounted.
As Trond said, this could lead to spamming the syslog, which will make it useless. This might be useful if the unknown options could be logged once, but logging each individual unknown option, each time that the file system mounted, makes this much less than desirable and could potentially lead to a denial of service attack.
The risks outweigh the benefits when viewed from the big picture.
ps