From: Benny Halevy <bhalevy@panasas.com>
To: "J. Bruce Fields" <bfields@citi.umich.edu>
Cc: linux-nfs@vger.kernel.org, pnfs@linux-nfs.org,
linux-fsdevel@vger.kernel.org,
Dean Hildebrand <dhildeb@us.ibm.com>
Subject: Re: [PATCH v2 04/35] pnfsd: return pnfs flags on exchange_id
Date: Tue, 08 Dec 2009 16:46:27 +0200 [thread overview]
Message-ID: <4B1E66C3.70907@panasas.com> (raw)
In-Reply-To: <20091207195141.GB32454@fieldses.org>
On Dec. 07, 2009, 21:51 +0200, " J. Bruce Fields" <bfields@citi.umich.edu> wrote:
> 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 <bhalevy@panasas.com>
>> [pnfsd: Fixup nfsd4_set_ex_flags.]
>> Signed-off-by: Dean Hildebrand <dhildeb@us.ibm.com>
>> [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 <bhalevy@panasas.com>
>> ---
>> 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.
The original motivation come from the client side who treats DSs differently
than MDSs with regards to renewing the lease.
If we return both flags set unconditionally, then the client will need
to remember internally what it uses the server for - an MDS or a DS.
Something along these lines (needs testing):
diff --git a/fs/nfs/nfs4filelayoutdev.c b/fs/nfs/nfs4filelayoutdev.c
index 128715a..cb8ae88 100644
--- a/fs/nfs/nfs4filelayoutdev.c
+++ b/fs/nfs/nfs4filelayoutdev.c
@@ -272,6 +272,9 @@ nfs4_pnfs_ds_create(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds)
if (err)
goto out_put;
+ /* mask out the server's MDS capability flag */
+ clp->cl_exchange_flags |= EXCHGID4_FLAG_USE_PNFS_DS;
+
if (!(clp->cl_exchange_flags & EXCHGID4_FLAG_USE_PNFS_DS)) {
printk(KERN_INFO "ip:port %s is not a pNFS Data Server\n",
ds->r_addr);
Benny
>
>> +#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
>>
next prev parent reply other threads:[~2009-12-08 14:46 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-07 9:26 [PATCH v2 0/35] Initial pnfsd file layout support Benny Halevy
2009-12-07 9:29 ` [PATCH v2 01/35] pnfsd: Define CONFIG_PNFSD Benny Halevy
2009-12-07 9:30 ` [PATCH v2 02/35] pnfsd: define NFSDDBG_PNFS Benny Halevy
2009-12-07 9:30 ` [PATCH v2 03/35] pnfsd, pnfs: protocol level pnfs constants Benny Halevy
2009-12-07 19:25 ` J. Bruce Fields
2009-12-08 14:31 ` Benny Halevy
2009-12-07 9:30 ` [PATCH v2 04/35] pnfsd: return pnfs flags on exchange_id Benny Halevy
2009-12-07 19:51 ` J. Bruce Fields
2009-12-08 14:46 ` Benny Halevy [this message]
2009-12-07 9:30 ` [PATCH v2 05/35] pnfsd: don't set up back channel on create_session for ds Benny Halevy
2009-12-07 20:10 ` J. Bruce Fields
2009-12-08 14:50 ` Benny Halevy
2009-12-07 9:31 ` [PATCH v2 06/35] pnfsd: introduce pnfsd header files Benny Halevy
2009-12-07 9:31 ` [PATCH v2 07/35] pnfsd: define pnfs_export_operations Benny Halevy
2009-12-07 9:31 ` [PATCH v2 08/35] pnfsd: add pnfs export option Benny Halevy
2009-12-07 9:31 ` [PATCH v2 09/35] pnfsd: layout verify Benny Halevy
2009-12-07 9:31 ` [PATCH v2 10/35] pnfsd: introduce exp_xdr.h Benny Halevy
2009-12-07 9:32 ` [PATCH v2 11/35] pnfsd: get device list/info Benny Halevy
2009-12-10 17:30 ` J. Bruce Fields
2009-12-10 18:53 ` Benny Halevy
2009-12-10 19:04 ` J. Bruce Fields
2009-12-10 19:21 ` Benny Halevy
2009-12-10 19:43 ` J. Bruce Fields
2009-12-07 9:32 ` [PATCH v2 12/35] pnfsd: filelayout: " Benny Halevy
2009-12-07 9:32 ` [PATCH v2 13/35] pnfsd: layout get Benny Halevy
2009-12-07 9:32 ` [PATCH v2 14/35] pnfsd: filelayout: layout encoding Benny Halevy
2009-12-07 9:33 ` [PATCH v2 15/35] pnfsd: Helper functions for layout stateid processing Benny Halevy
2009-12-07 9:33 ` [PATCH v2 16/35] pnfsd: helper function for stateid checking Benny Halevy
2009-12-07 9:33 ` [PATCH v2 17/35] pnfsd: process the layout stateid Benny Halevy
2009-12-07 9:33 ` [PATCH v2 18/35] pnfsd: add helper functions for identifying DS stateids Benny Halevy
2009-12-07 9:33 ` [PATCH v2 19/35] pnfsd: accept all ds stateids Benny Halevy
2009-12-07 9:34 ` [PATCH v2 20/35] pnfsd: LAYOUTGET layout stateid processing Benny Halevy
2009-12-07 9:34 ` [PATCH v2 21/35] pnfsd: destroy layout on expire_client Benny Halevy
2009-12-07 9:34 ` [PATCH v2 22/35] pnfsd: support layout_type attribute Benny Halevy
2009-12-07 9:34 ` [PATCH v2 23/35] pnfsd: per block device dlm data server list cache Benny Halevy
2009-12-07 9:35 ` [PATCH v2 24/35] pnfsd: new nfsd filesystem file: pnfs_dlm_device Benny Halevy
2009-12-07 9:35 ` [PATCH v2 25/35] pnfsd: nfsd4_pnfs_dlm_getdeviter Benny Halevy
2009-12-07 9:35 ` [PATCH v2 26/35] pnfsd: nfsd4_pnfs_dlm_getdevinfo Benny Halevy
2009-12-07 9:35 ` [PATCH v2 27/35] pnfsd: nfsd4_pnfs_dlm_layoutget Benny Halevy
2009-12-07 9:36 ` [PATCH v2 28/35] pnfsd: add dlm file layout layout-type Benny Halevy
2009-12-07 9:36 ` [PATCH v2 29/35] pnfsd: dlm pnfs_export_operations Benny Halevy
2009-12-07 9:36 ` [PATCH v2 30/35] pnfsd: gfs2: use generic file layout pnfs operations vector Benny Halevy
2009-12-07 9:36 ` [PATCH v2 31/35] posix_acl: resolve compile dependency in posix_acl.h Benny Halevy
2009-12-07 9:36 ` [PATCH v2 32/35] nfs: resolve compile dependency in nfs_xdr.h Benny Halevy
2009-12-07 9:37 ` [PATCH v2 33/35] pnfsd: layout commit Benny Halevy
2009-12-07 9:37 ` [PATCH v2 34/35] pnfsd: layout return Benny Halevy
2009-12-07 9:37 ` [PATCH v2 35/35] pnfsd: layoutreturn stateid processing Benny Halevy
2009-12-07 9:54 ` [pnfs] [PATCH v2 0/35] Initial pnfsd file layout support Benny Halevy
2009-12-09 10:24 ` [PATCH 0/9] fixes to Initial pnfsd file layout support v2, comments {3,4,5}/35 Benny Halevy
2009-12-09 10:27 ` [PATCH 1/3] SQUASHME: pnfsd: unify enum pnfs_layout{return,recall}_type Benny Halevy
2009-12-09 10:27 ` [PATCH 2/3] SQUASHME: pnfsd: always set both MDS and DS exchangeid capability flags Benny Halevy
2009-12-09 18:54 ` J. Bruce Fields
2009-12-09 10:27 ` [PATCH 3/3] SQUASHME: pnfsd: define a is_ds_only_session helper Benny Halevy
2009-12-09 10:27 ` [PATCH 4/4] SQUASHME: pnfsd: use only RETURN_* constants Benny Halevy
2009-12-09 10:27 ` [PATCH 5/5] SQUASHME: spnfs: " Benny Halevy
2009-12-09 10:28 ` [PATCH 6/6] SQUASHME: spnfs-block: " Benny Halevy
2009-12-09 10:28 ` [PATCH 7/7] SQUASHME: pnfsd-exofs: use only pnfs_layoutreturn_type Benny Halevy
2009-12-09 10:28 ` [PATCH 8/9] SQUASHME: pnfs: " Benny Halevy
2009-12-09 10:28 ` [PATCH 9/9] SQUASHME: pnfs: filelayout: mask out server's MDS capability flag for DSs Benny Halevy
2009-12-09 22:21 ` [pnfs] " Benny Halevy
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=4B1E66C3.70907@panasas.com \
--to=bhalevy@panasas.com \
--cc=bfields@citi.umich.edu \
--cc=dhildeb@us.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=pnfs@linux-nfs.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