From: "Batsakis, Alexandros" Subject: RE: [PATCH 2/3] SQUASHME pnfs_submit: update DS nfs4_set_client Date: Thu, 13 May 2010 12:13:46 -0700 Message-ID: References: <1273685980-3340-1-git-send-email-andros@netapp.com> <1273685980-3340-2-git-send-email-andros@netapp.com> <1273685980-3340-3-git-send-email-andros@netapp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: To: "Adamson, Andy" , Return-path: Received: from mx2.netapp.com ([216.240.18.37]:62482 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932487Ab0EMTNu convert rfc822-to-8bit (ORCPT ); Thu, 13 May 2010 15:13:50 -0400 In-Reply-To: <1273685980-3340-3-git-send-email-andros@netapp.com> Sender: linux-nfs-owner@vger.kernel.org List-ID: > -----Original Message----- > From: Adamson, Andy > Sent: Wednesday, May 12, 2010 10:40 AM > To: bhalevy@panasas.com > Cc: linux-nfs@vger.kernel.org; Adamson, Andy > Subject: [PATCH 2/3] SQUASHME pnfs_submit: update DS nfs4_set_client > > From: Andy Adamson > > 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 > --- > 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 Hi Andy, Is there a way to avoid creating a new nfs_client altogether and just re-use the existing one along with its session ? -a > > -- > To unsubscribe from this list: send the line "unsubscribe linux-nfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html