Skip to contentSkip to conversation

Confused about 'sloppy' option parsing in NFS.

DISCUSSION Neil Brown 2 participants 2 messages Sep 5, 2008 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Neil Brown

author
#0 lore raw

The kernel used by OpenSUSE-11.0 complains when automount passes a 'grpid' option. So I'm looking at backporting the 'sloppy' option parsing fix. But I'm confused.

Looking at commit f45663ce5fb30f76a3414ab3ac69f4dd320e760a

It introduced 'sloppy' and 'errors' in nfs_parse_mount_options, possibly sets them to some non-zero value based on what it finds, and then does absolutely nothing with them.

nfs_parse_mount_options only returns zero if:
- memalloc fails
- security_sb_parse_opts_str fails

But never if there is an unrecognised argument.

This functionality is obviously quite trivial to backport, but I wonder if it is correct.

Is it just a simple slip up, or am I missing something?

Thanks,
NeilBrown

A message that is not in the archive (sent off-list or not yet received): 18624.55656.904241.183933-wvvUuzkyo1EYVZTmpyfIwg@public.gmane.org

#2 lore raw
Quoted 15 lines · Neil Brown

The kernel used by OpenSUSE-11.0 complains when automount passes a 'grpid' option. So I'm looking at backporting the 'sloppy' option parsing fix. But I'm confused.

Looking at commit f45663ce5fb30f76a3414ab3ac69f4dd320e760a

It introduced 'sloppy' and 'errors' in nfs_parse_mount_options, possibly sets them to some non-zero value based on what it finds, and then does absolutely nothing with them.

nfs_parse_mount_options only returns zero if:
- memalloc fails
- security_sb_parse_opts_str fails

Quoted 6 lines

But never if there is an unrecognised argument.

This functionality is obviously quite trivial to backport, but I wonder if it is correct.

Is it just a simple slip up, or am I missing something?

There was a lot of controversy around this patch and several others in the same area. As usual an important hunk got dropped in the final version I sent in. Something like this:

@@ -1182,6 +1250,12 @@ static int nfs_parse_mount_options(char *raw,

                break;
        }

+ if (errors > 0) {
+ dfprintk(MOUNT, "NFS: parsing encountered %d error%s\n",
+ errors, (errors == 1 ? "" : "s"));
+ if (!sloppy)
+ return 0;
+ }

        return 1;

out_nomem:

I found this in my git repo on linux-nfs.org in commit 17cdb8c69388cc7611adb4d43c46cfa1ec4938c2. I can post a tested delta for 26-stable and 27-rc later today.

--
Chuck Lever