From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chuck Lever Subject: Re: [PATCH 08/13] NFS: Add functions to parse nfs mount options to fs/nfs/super.c Date: Tue, 29 May 2007 17:08:01 -0400 Message-ID: <465C9631.1070300@oracle.com> References: <20070521160954.18993.14761.stgit@manray.1015granger.net> <20070529202123.GA5473@petra.dvoda.cz> Reply-To: chuck.lever@oracle.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020300070501030506070102" Cc: akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org To: Karel Zak Return-path: Received: from rgminet01.oracle.com ([148.87.113.118]:64333 "EHLO rgminet01.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751733AbXE2VIg (ORCPT ); Tue, 29 May 2007 17:08:36 -0400 In-Reply-To: <20070529202123.GA5473@petra.dvoda.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org This is a multi-part message in MIME format. --------------020300070501030506070102 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Karel Zak wrote: > 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- I've never used the context= option, and didn't find any documentation describing how it was used. Is there a clean example of how to use the in-kernel parser to handle quoted strings containing commas? --------------020300070501030506070102 Content-Type: text/x-vcard; charset=utf-8; name="chuck.lever.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="chuck.lever.vcf" 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 url:http://oss.oracle.com/~cel/ version:2.1 end:vcard --------------020300070501030506070102--