From: " J. Bruce Fields" Subject: Re: [PATCH v2 04/35] pnfsd: return pnfs flags on exchange_id Date: Mon, 7 Dec 2009 14:51:41 -0500 Message-ID: <20091207195141.GB32454@fieldses.org> References: <4B1CCA52.8020900@panasas.com> <1260178237-14780-1-git-send-email-bhalevy@panasas.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-nfs@vger.kernel.org, pnfs@linux-nfs.org, linux-fsdevel@vger.kernel.org, Dean Hildebrand To: Benny Halevy Return-path: Received: from fieldses.org ([174.143.236.118]:52513 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932781AbZLGTvc (ORCPT ); Mon, 7 Dec 2009 14:51:32 -0500 In-Reply-To: <1260178237-14780-1-git-send-email-bhalevy@panasas.com> Sender: linux-nfs-owner@vger.kernel.org List-ID: On Mon, Dec 07, 2009 at 11:30:37AM +0200, Benny Halevy wrote: > Set the cl_exchange_flags to be non_pnfs if we do not set > either pnfs or ds (in the plain old nfs41 case). > > pnfsd: set EXCHGID4_FLAG_USE_NON_PNFS when !CONFIG_PNFSD: > EXCHGID4_FLAG_USE_NON_PNFS should be set when the server does not support > operations (e.g. LAYOUTGET) or attributes that pertain to pNFS. > > [extraced from pnfsd: Initial pNFS server implementation.] > Signed-off-by: Benny Halevy > [pnfsd: Fixup nfsd4_set_ex_flags.] > Signed-off-by: Dean Hildebrand > [pnfsd: set EXCHGID4_FLAG_USE_NON_PNFS when !CONFIG_PNFSD] > [pnfsd: fix compiler warning in nfsd4_set_ex_flags when CONFIG_PNFSD is not defined] > Signed-off-by: Benny Halevy > --- > fs/nfsd/nfs4state.c | 15 +++++++++++++++ > 1 files changed, 15 insertions(+), 0 deletions(-) > > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c > index 2923e6c..9ecbc25 100644 > --- a/fs/nfsd/nfs4state.c > +++ b/fs/nfsd/nfs4state.c > @@ -1098,8 +1098,23 @@ nfsd4_replay_cache_entry(struct nfsd4_compoundres *resp, > static void > nfsd4_set_ex_flags(struct nfs4_client *new, struct nfsd4_exchange_id *clid) > { > +#if defined(CONFIG_PNFSD) > + int mds_and_ds = EXCHGID4_FLAG_USE_PNFS_MDS | EXCHGID4_FLAG_USE_PNFS_DS; > + int mds_or_ds = 0; initialization isn't used. > + > + /* Save the client's MDS or DS flags, or set them both. > + * XXX We currently do not have a method of determining > + * what a server supports prior to receiving a filehandle > + * e.g. at exchange id time. */ > + mds_or_ds = clid->flags & mds_and_ds; > + if (mds_or_ds) > + new->cl_exchange_flags |= mds_or_ds; > + else > + new->cl_exchange_flags |= mds_and_ds; Why do we need to do this? If the fact is that we're going to accept either DS or MDS traffic over this session, let's just always set both flags. That doesn't stop the client from dedicating sessions to one or the other use if that's what it wants. > +#else /* CONFIG_PNFSD */ > /* pNFS is not supported */ > new->cl_exchange_flags |= EXCHGID4_FLAG_USE_NON_PNFS; > +#endif /* CONFIG_PNFSD */ The ifdef should be easy enough to hide in the usual way, with a conditionally defined new->cl_exchange_flags |= get_pnfs_flags(clid->flags) (or something to that effect). --b. > > /* Referrals are supported, Migration is not. */ > new->cl_exchange_flags |= EXCHGID4_FLAG_SUPP_MOVED_REFER; > -- > 1.6.5.1 >