From: Karel Zak Subject: Re: [PATCH 08/13] NFS: Add functions to parse nfs mount options to fs/nfs/super.c Date: Tue, 29 May 2007 22:21:23 +0200 Message-ID: <20070529202123.GA5473@petra.dvoda.cz> References: <20070521160954.18993.14761.stgit@manray.1015granger.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org To: Chuck Lever Return-path: Received: from mx1.redhat.com ([66.187.233.31]:55639 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759635AbXE2UW0 (ORCPT ); Tue, 29 May 2007 16:22:26 -0400 Content-Disposition: inline In-Reply-To: <20070521160954.18993.14761.stgit@manray.1015granger.net> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Mon, May 21, 2007 at 12:09:54PM -0400, Chuck Lever wrote: > For NFSv2 and NFSv3 mount options. > Signed-off-by: Chuck Lever .... > +static int nfs_parse_options(char *raw, struct nfs_mount_args *mnt) > +{ > + char *p, *string; > + > + if (!raw) { > + dprintk("NFS: mount options string was NULL.\n"); > + return 1; > + } > + > + while ((p = strsep (&raw, ",")) != NULL) { > + substring_t args[MAX_OPT_ARGS]; > + int option, token; > + > + if (!*p) > + continue; > + token = match_token(p, nfs_tokens, args); .... > + > + case Opt_context: > + match_strcpy(mnt->nmd.context, args); > + break; The userspace version (nfs-utils) of this code supports a quoted context strings. For example: context="aaa,bbb,ccc",hard It seems your code blindly parses a raw option string by ",". Karel -- Karel Zak