Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fdb66ff4 authored by Chuck Lever's avatar Chuck Lever Committed by Trond Myklebust
Browse files

NFS: mount option parser chokes on proto=



The new text-based NFS mount option parsing logic doesn't recognize any
valid transport protocols due to a silly mistake in the protocol token
matching logic.  This prevents basic mount requests such as:

   mount.nfs server:/export /mnt -o proto=tcp

from working with the new text-based NFS mount API.

Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent deee9369
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -911,13 +911,13 @@ static int nfs_parse_mount_options(char *raw,
			kfree(string);
			kfree(string);


			switch (token) {
			switch (token) {
			case Opt_udp:
			case Opt_xprt_udp:
				mnt->flags &= ~NFS_MOUNT_TCP;
				mnt->flags &= ~NFS_MOUNT_TCP;
				mnt->nfs_server.protocol = IPPROTO_UDP;
				mnt->nfs_server.protocol = IPPROTO_UDP;
				mnt->timeo = 7;
				mnt->timeo = 7;
				mnt->retrans = 5;
				mnt->retrans = 5;
				break;
				break;
			case Opt_tcp:
			case Opt_xprt_tcp:
				mnt->flags |= NFS_MOUNT_TCP;
				mnt->flags |= NFS_MOUNT_TCP;
				mnt->nfs_server.protocol = IPPROTO_TCP;
				mnt->nfs_server.protocol = IPPROTO_TCP;
				mnt->timeo = 600;
				mnt->timeo = 600;
@@ -936,10 +936,10 @@ static int nfs_parse_mount_options(char *raw,
			kfree(string);
			kfree(string);


			switch (token) {
			switch (token) {
			case Opt_udp:
			case Opt_xprt_udp:
				mnt->mount_server.protocol = IPPROTO_UDP;
				mnt->mount_server.protocol = IPPROTO_UDP;
				break;
				break;
			case Opt_tcp:
			case Opt_xprt_tcp:
				mnt->mount_server.protocol = IPPROTO_TCP;
				mnt->mount_server.protocol = IPPROTO_TCP;
				break;
				break;
			default:
			default: