Re: [PATCH] NFS: Fix handling of commmand line options for NFSROOT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mar 10, 2011, at 10:43 AM, Mark Brown wrote:

> Commmit 972903 (NFS: NFSROOT should default to "proto=udp") added a
> default NFS mount option using the existing in-kernel code to parse
> mount options out of the command line. This exposed a bug in the
> existing code - it would not add a , separating the existing options
> from the new options resulting in strings such as "udprsize=1024"
> rather than "udp,rsize=1024"
> 
> Fix this by adding a , before the new options if the options are not
> empty when we append.

Looks like a real bug.

We might be better off teaching root_nfs_cat() to deal with the extra comma as necessary right when we concatenate the options strings.  That would simplify it's callers.

> Signed-off-by: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
> ---
> fs/nfs/nfsroot.c |    7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c
> index 0bc654f..309df59 100644
> --- a/fs/nfs/nfsroot.c
> +++ b/fs/nfs/nfsroot.c
> @@ -193,10 +193,15 @@ static int __init root_nfs_parse_options(char *incoming, char *exppath,
> 	 * @incoming now points to the rest of the string; if it
> 	 * contains something, append it to our root options buffer
> 	 */
> -	if (incoming != NULL && *incoming != '\0')
> +	if (incoming != NULL && *incoming != '\0') {
> +		if (nfs_root_options[0] != '\0' &&
> +		    root_nfs_cat(nfs_root_options, ",",
> +						sizeof(nfs_root_options)))
> +			return -1;
> 		if (root_nfs_cat(nfs_root_options, incoming,
> 						sizeof(nfs_root_options)))
> 			return -1;
> +	}
> 
> 	/*
> 	 * Possibly prepare for more options to be appended
> -- 
> 1.7.2.3
> 

-- 
Chuck Lever
chuck[dot]lever[at]oracle[dot]com




--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux