Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294513
b: refs/heads/master
c: 31b8e2a
h: refs/heads/master
i:
  294511: da1523c
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Mar 2, 2012
1 parent 67271b1 commit dda3f5f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2e738fdce22f9a7edf20281fd2d768ef9785922e
refs/heads/master: 31b8e2aec099f22d40277c424d8c24b2a4c95fce
15 changes: 15 additions & 0 deletions trunk/fs/nfs/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1346,6 +1346,7 @@ int nfs4_init_client(struct nfs_client *clp,
rpc_authflavor_t authflavour,
int noresvport)
{
char buf[INET6_ADDRSTRLEN + 1];
int error;

if (clp->cl_cons_state == NFS_CS_READY) {
Expand All @@ -1361,6 +1362,20 @@ int nfs4_init_client(struct nfs_client *clp,
1, noresvport);
if (error < 0)
goto error;

/* If no clientaddr= option was specified, find a usable cb address */
if (ip_addr == NULL) {
struct sockaddr_storage cb_addr;
struct sockaddr *sap = (struct sockaddr *)&cb_addr;

error = rpc_localaddr(clp->cl_rpcclient, sap, sizeof(cb_addr));
if (error < 0)
goto error;
error = rpc_ntop(sap, buf, sizeof(buf));
if (error < 0)
goto error;
ip_addr = (const char *)buf;
}
strlcpy(clp->cl_ipaddr, ip_addr, sizeof(clp->cl_ipaddr));

error = nfs_idmap_new(clp);
Expand Down
6 changes: 0 additions & 6 deletions trunk/fs/nfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -2557,12 +2557,6 @@ static int nfs4_validate_text_mount_data(void *options,
return -EINVAL;
}

if (args->client_address == NULL) {
dfprintk(MOUNT,
"NFS4: mount program didn't pass callback address\n");
return -EINVAL;
}

return nfs_parse_devname(dev_name,
&args->nfs_server.hostname,
NFS4_MAXNAMLEN,
Expand Down

0 comments on commit dda3f5f

Please sign in to comment.