From: "J. Bruce Fields" <bfields@fieldses.org>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 6/6] NFSv4.1: Enable state protection
Date: Mon, 20 May 2013 16:40:09 -0400 [thread overview]
Message-ID: <20130520204009.GH14677@fieldses.org> (raw)
In-Reply-To: <1369070227-40671-6-git-send-email-Trond.Myklebust@netapp.com>
On Mon, May 20, 2013 at 01:17:07PM -0400, Trond Myklebust wrote:
> Use the EXCHGID4_FLAG_BIND_PRINC_STATEID exchange_id flag to enable
> stateid protection. This means that if we create a stateid using a
> particular principal, then we must use the same principal if we
> want to change that state.
Note that knfsd ignores this--its EXCHANGE_ID will always return with
the flag unset regardless of what the client requests. My understanding
is that that's legal ("Whether a bit is set or cleared on the arguments'
flags does not force the server to set or clear the same bit on the
results' side.")
(Definitely not opposed to implementing it, just haven't gotten around
to it.)
--b.
> IOW: if we OPEN a file using a particular credential, then we have
> to use the same credential in subsequent OPEN_DOWNGRADE, CLOSE,
> or DELEGRETURN operations that use that stateid.
>
> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
> ---
> fs/nfs/nfs4proc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index 7cdc706..3e21d43 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -5528,7 +5528,8 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
> struct nfs41_exchange_id_args args = {
> .verifier = &verifier,
> .client = clp,
> - .flags = EXCHGID4_FLAG_SUPP_MOVED_REFER,
> + .flags = EXCHGID4_FLAG_SUPP_MOVED_REFER |
> + EXCHGID4_FLAG_BIND_PRINC_STATEID,
> };
> struct nfs41_exchange_id_res res = {
> 0
> --
> 1.8.1.4
>
> --
> 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
next prev parent reply other threads:[~2013-05-20 20:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-20 17:17 [PATCH 1/6] NFSv4.1: Ensure that layoutget is called using the layout credential Trond Myklebust
2013-05-20 17:17 ` [PATCH 2/6] NFSv4.1: Ensure that layoutreturn uses the correct credential Trond Myklebust
2013-05-20 17:17 ` [PATCH 3/6] NFSv4.1: Ensure that reclaim_complete uses the right credential Trond Myklebust
2013-05-20 17:17 ` [PATCH 4/6] NFSv4.1: Ensure that test_stateid and free_stateid use correct credentials Trond Myklebust
2013-05-20 17:17 ` [PATCH 5/6] NFSv4.1: Use layout credentials for get_deviceinfo calls Trond Myklebust
2013-05-20 17:17 ` [PATCH 6/6] NFSv4.1: Enable state protection Trond Myklebust
2013-05-20 20:40 ` J. Bruce Fields [this message]
2013-05-20 21:10 ` Myklebust, Trond
2013-05-20 21:25 ` J. Bruce Fields
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=20130520204009.GH14677@fieldses.org \
--to=bfields@fieldses.org \
--cc=Trond.Myklebust@netapp.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).