Commit 17094272 authored by Stanislav Kinsbursky's avatar Stanislav Kinsbursky Committed by Trond Myklebust

NFS: decode destination address in proper network namespace context

This patch replaces "init_net" with NFS client's owner net in rpc_pton() call
in decode_ds_addr().
Signed-off-by: default avatarStanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 599ec129
...@@ -378,7 +378,7 @@ nfs4_pnfs_ds_add(struct list_head *dsaddrs, gfp_t gfp_flags) ...@@ -378,7 +378,7 @@ nfs4_pnfs_ds_add(struct list_head *dsaddrs, gfp_t gfp_flags)
* Currently only supports ipv4, ipv6 and one multi-path address. * Currently only supports ipv4, ipv6 and one multi-path address.
*/ */
static struct nfs4_pnfs_ds_addr * static struct nfs4_pnfs_ds_addr *
decode_ds_addr(struct xdr_stream *streamp, gfp_t gfp_flags) decode_ds_addr(struct net *net, struct xdr_stream *streamp, gfp_t gfp_flags)
{ {
struct nfs4_pnfs_ds_addr *da = NULL; struct nfs4_pnfs_ds_addr *da = NULL;
char *buf, *portstr; char *buf, *portstr;
...@@ -457,7 +457,7 @@ decode_ds_addr(struct xdr_stream *streamp, gfp_t gfp_flags) ...@@ -457,7 +457,7 @@ decode_ds_addr(struct xdr_stream *streamp, gfp_t gfp_flags)
INIT_LIST_HEAD(&da->da_node); INIT_LIST_HEAD(&da->da_node);
if (!rpc_pton(&init_net, buf, portstr-buf, (struct sockaddr *)&da->da_addr, if (!rpc_pton(net, buf, portstr-buf, (struct sockaddr *)&da->da_addr,
sizeof(da->da_addr))) { sizeof(da->da_addr))) {
dprintk("%s: error parsing address %s\n", __func__, buf); dprintk("%s: error parsing address %s\n", __func__, buf);
goto out_free_da; goto out_free_da;
...@@ -625,7 +625,8 @@ decode_device(struct inode *ino, struct pnfs_device *pdev, gfp_t gfp_flags) ...@@ -625,7 +625,8 @@ decode_device(struct inode *ino, struct pnfs_device *pdev, gfp_t gfp_flags)
mp_count = be32_to_cpup(p); /* multipath count */ mp_count = be32_to_cpup(p); /* multipath count */
for (j = 0; j < mp_count; j++) { for (j = 0; j < mp_count; j++) {
da = decode_ds_addr(&stream, gfp_flags); da = decode_ds_addr(NFS_SERVER(ino)->nfs_client->net,
&stream, gfp_flags);
if (da) if (da)
list_add_tail(&da->da_node, &dsaddrs); list_add_tail(&da->da_node, &dsaddrs);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment