aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4filelayoutdev.c
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-01-19 10:05:57 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-01-31 19:28:17 -0500
commit170942726b16a1dfcc605f0b510b9663b66fa7a3 (patch)
tree817e78cec892e98e684bb89f01ecd8e03f1a6aba /fs/nfs/nfs4filelayoutdev.c
parent599ec129c2f0e4da955bef685880260de1813c85 (diff)
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: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4filelayoutdev.c')
-rw-r--r--fs/nfs/nfs4filelayoutdev.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/nfs/nfs4filelayoutdev.c b/fs/nfs/nfs4filelayoutdev.c
index 0d8b9523a3cb..6eb59b044bfc 100644
--- a/fs/nfs/nfs4filelayoutdev.c
+++ b/fs/nfs/nfs4filelayoutdev.c
@@ -378,7 +378,7 @@ out:
378 * Currently only supports ipv4, ipv6 and one multi-path address. 378 * Currently only supports ipv4, ipv6 and one multi-path address.
379 */ 379 */
380static struct nfs4_pnfs_ds_addr * 380static struct nfs4_pnfs_ds_addr *
381decode_ds_addr(struct xdr_stream *streamp, gfp_t gfp_flags) 381decode_ds_addr(struct net *net, struct xdr_stream *streamp, gfp_t gfp_flags)
382{ 382{
383 struct nfs4_pnfs_ds_addr *da = NULL; 383 struct nfs4_pnfs_ds_addr *da = NULL;
384 char *buf, *portstr; 384 char *buf, *portstr;
@@ -457,7 +457,7 @@ decode_ds_addr(struct xdr_stream *streamp, gfp_t gfp_flags)
457 457
458 INIT_LIST_HEAD(&da->da_node); 458 INIT_LIST_HEAD(&da->da_node);
459 459
460 if (!rpc_pton(&init_net, buf, portstr-buf, (struct sockaddr *)&da->da_addr, 460 if (!rpc_pton(net, buf, portstr-buf, (struct sockaddr *)&da->da_addr,
461 sizeof(da->da_addr))) { 461 sizeof(da->da_addr))) {
462 dprintk("%s: error parsing address %s\n", __func__, buf); 462 dprintk("%s: error parsing address %s\n", __func__, buf);
463 goto out_free_da; 463 goto out_free_da;
@@ -625,7 +625,8 @@ decode_device(struct inode *ino, struct pnfs_device *pdev, gfp_t gfp_flags)
625 625
626 mp_count = be32_to_cpup(p); /* multipath count */ 626 mp_count = be32_to_cpup(p); /* multipath count */
627 for (j = 0; j < mp_count; j++) { 627 for (j = 0; j < mp_count; j++) {
628 da = decode_ds_addr(&stream, gfp_flags); 628 da = decode_ds_addr(NFS_SERVER(ino)->nfs_client->net,
629 &stream, gfp_flags);
629 if (da) 630 if (da)
630 list_add_tail(&da->da_node, &dsaddrs); 631 list_add_tail(&da->da_node, &dsaddrs);
631 } 632 }