linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: andros@netapp.com
To: bhalevy@panasas.com
Cc: linux-nfs@vger.kernel.org, Andy Adamson <andros@netapp.com>
Subject: [PATCH 2/3] SQUASHME pnfs_submit: update DS nfs4_set_client
Date: Wed, 12 May 2010 13:39:39 -0400	[thread overview]
Message-ID: <1273685980-3340-3-git-send-email-andros@netapp.com> (raw)
In-Reply-To: <1273685980-3340-2-git-send-email-andros@netapp.com>

From: Andy Adamson <andros@netapp.com>

Dont bother using the hostname, use the client ipaddr field from the MDS
nfs_client for construction of the co_ownrid field the DS EXCHANGE_ID.

Clean up the comments.

Squash into "pnfs: filelayout: device ops"

Signed-off-by: Andy Adamson <andros@netapp.com>
---
 fs/nfs/nfs4filelayoutdev.c |   28 +++++-----------------------
 1 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/fs/nfs/nfs4filelayoutdev.c b/fs/nfs/nfs4filelayoutdev.c
index 891c31d..b41f437 100644
--- a/fs/nfs/nfs4filelayoutdev.c
+++ b/fs/nfs/nfs4filelayoutdev.c
@@ -128,8 +128,6 @@ nfs4_pnfs_ds_create(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds)
 	struct rpc_clnt 	*mds_clnt = mds_srv->client;
 	struct nfs_client	*clp = mds_srv->nfs_client;
 	struct sockaddr		*mds_addr;
-	char			ip_addr[16];
-	int			addrlen;
 	int err = 0;
 
 	dprintk("--> %s ip:port %s au_flavor %d\n", __func__,
@@ -156,32 +154,16 @@ nfs4_pnfs_ds_create(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds)
 		}
 		goto out;
 	}
-	/* Set timeout to the mds rpc clnt value.
-	 * XXX - find the correct authflavor....
-	 *
-	 * Fake a client ipaddr (used for sessionid) with hostname
-	 * Use hostname since it might be more unique than ipaddr (which
-	 * could be set to the loopback 127.0.0/1.1
-	 *
-	 * XXX: Should sessions continue to use the cl_ipaddr field?
-	 */
-	addrlen = strnlen(utsname()->nodename, sizeof(utsname()->nodename));
-	if (addrlen > sizeof(ip_addr))
-		addrlen = sizeof(ip_addr);
-	memcpy(ip_addr, utsname()->nodename, addrlen);
-
-	/* XXX need a non-nfs_client struct interface to set up
-	 * data server sessions
-	 *
-	 * tmp: nfs4_set_client sets the nfs_server->nfs_client.
-	 *
-	 * We specify a retrans and timeout interval equual to MDS. ??
+	/*
+	 * Set a retrans, timeout interval, and authflavor equual to the MDS
+	 * values. Use the MDS nfs_client cl_ipaddr field so as to use the
+	 * same co_ownerid as the MDS.
 	 */
 	err = nfs4_set_client(&tmp,
 			      mds_srv->nfs_client->cl_hostname,
 			      (struct sockaddr *)&sin,
 			      sizeof(struct sockaddr),
-			      ip_addr,
+			      mds_srv->nfs_client->cl_ipaddr,
 			      mds_clnt->cl_auth->au_flavor,
 			      IPPROTO_TCP,
 			      mds_clnt->cl_xprt->timeout,
-- 
1.6.6


  reply	other threads:[~2010-05-12 17:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-12 17:39 [PATCH 0/3] Use MDS session for dual role MDS/DS andros
2010-05-12 17:39 ` [PATCH 1/3] SQUASHME pnfs_submit: use MDS session for dual MDS/DS andros
2010-05-12 17:39   ` andros [this message]
2010-05-12 17:39     ` [PATCH 3/3] SQUASHME pnfs_submit: cleanup DS exchange flag processing andros
2010-05-13 19:13     ` [PATCH 2/3] SQUASHME pnfs_submit: update DS nfs4_set_client Batsakis, Alexandros
     [not found]       ` <B9364369CA66BF45806C2CD86EAB8BA60607E6A4-hX7t0kiaRRqx3DEm5hsDiAK/GNPrWCqfQQ4Iyu8u01E@public.gmane.org>
2010-05-13 19:29         ` Batsakis, Alexandros

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1273685980-3340-3-git-send-email-andros@netapp.com \
    --to=andros@netapp.com \
    --cc=bhalevy@panasas.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).