From: James Lentini Date: Mon, 24 Sep 2007 21:32:49 +0000 (-0400) Subject: [NFS] [PATCH] NFS: initialize default port in kernel mount client X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=aad700073557c7932ef9f81c19a5e0647f8a6850;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [NFS] [PATCH] NFS: initialize default port in kernel mount client If no mount server port number is specified, the previous change to the kernel mount client inadvertently allows the NFS server's port number to be the used as the mount server's port number. If the user specifies an NFS server port (-o port=x), the mount will fail. The fix below sets the mount server's port to 0 if no mount server port is specified by the user. Signed-off-by: James Lentini Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 5085f53be2fe..094d2f832c3c 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -1027,8 +1027,10 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args, sin = args->mount_server.address; else sin = args->nfs_server.address; - if (args->mount_server.port != 0) - sin.sin_port = htons(args->mount_server.port); + /* + * autobind will be used if mount_server.port == 0 + */ + sin.sin_port = htons(args->mount_server.port); /* * Now ask the mount server to map our export path