]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
NFS: Fix a problem with the legacy binary mount code
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 4 Sep 2012 15:05:07 +0000 (11:05 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 19 Sep 2012 14:05:07 +0000 (15:05 +0100)
commit 872ece86ea5c367aa92f44689c2d01a1c767aeb3 upstream.

Apparently, am-utils is still using the legacy binary mountdata interface,
and is having trouble parsing /proc/mounts due to the 'port=' field being
incorrectly set.

The following patch should fix up the regression.

Reported-by: Marius Tolzmann <tolzmann@molgen.mpg.de>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/nfs/super.c

index 6e85ec64bf4b12a7288d7ed9302d46ca9c02817d..e42d6f65d6e29b3d77fc6289469b954c3e82eae0 100644 (file)
@@ -1820,6 +1820,7 @@ static int nfs_validate_mount_data(void *options,
 
                memcpy(sap, &data->addr, sizeof(data->addr));
                args->nfs_server.addrlen = sizeof(data->addr);
+               args->nfs_server.port = ntohs(data->addr.sin_port);
                if (!nfs_verify_server_address(sap))
                        goto out_no_address;
 
@@ -2538,6 +2539,7 @@ static int nfs4_validate_mount_data(void *options,
                        return -EFAULT;
                if (!nfs_verify_server_address(sap))
                        goto out_no_address;
+               args->nfs_server.port = ntohs(((struct sockaddr_in *)sap)->sin_port);
 
                if (data->auth_flavourlen) {
                        if (data->auth_flavourlen > 1)