浏览代码

nfs[23] tcp breakage in mount with binary options

We forget to set nfs_server.protocol in tcp case when old-style binary
options are passed to mount.  The thing remains zero and never validated
afterwards.  As the result, we hit BUG in fs/nfs/client.c:588.

Breakage has been introduced in NFS: Add nfs_alloc_parsed_mount_data
merged yesterday...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Al Viro 15 年之前
父节点
当前提交
36dd2fdb37
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      fs/nfs/super.c

+ 2 - 0
fs/nfs/super.c

@@ -1711,6 +1711,8 @@ static int nfs_validate_mount_data(void *options,
 
 
 		if (!(data->flags & NFS_MOUNT_TCP))
 		if (!(data->flags & NFS_MOUNT_TCP))
 			args->nfs_server.protocol = XPRT_TRANSPORT_UDP;
 			args->nfs_server.protocol = XPRT_TRANSPORT_UDP;
+		else
+			args->nfs_server.protocol = XPRT_TRANSPORT_TCP;
 		/* N.B. caller will free nfs_server.hostname in all cases */
 		/* N.B. caller will free nfs_server.hostname in all cases */
 		args->nfs_server.hostname = kstrdup(data->hostname, GFP_KERNEL);
 		args->nfs_server.hostname = kstrdup(data->hostname, GFP_KERNEL);
 		args->namlen		= data->namlen;
 		args->namlen		= data->namlen;