Re: [PATCH 08/13] NFS: Add functions to parse nfs mount options to fs/nfs/super.c

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

 



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 <chuck.lever@xxxxxxxxxx>

 ....

+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?
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


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux