From: Chuck Lever <chuck.lever@oracle.com>
To: Bruce Fields <bfields@redhat.com>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH v3 9/9] nfsd: cstate->session->se_client -> cstate->clp
Date: Thu, 21 Jan 2021 23:34:39 +0000 [thread overview]
Message-ID: <E452A0A0-4015-4901-8EC5-27EB73BEEC3F@oracle.com> (raw)
In-Reply-To: <1611269865-30153-9-git-send-email-bfields@redhat.com>
Hi Bruce-
> On Jan 21, 2021, at 5:57 PM, J. Bruce Fields <bfields@redhat.com> wrote:
>
> From: "J. Bruce Fields" <bfields@redhat.com>
>
> I'm not sure why we're writing this out the hard way in so many places.
>
> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Thanks. v3 of this series has been committed to the for-next branch at
git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git
in preparation for the v5.12 merge window.
> ---
> fs/nfsd/nfs4proc.c | 5 ++---
> fs/nfsd/nfs4state.c | 16 ++++++++--------
> 2 files changed, 10 insertions(+), 11 deletions(-)
>
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index 567af1f10d2c..f63a12a5278a 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -373,8 +373,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
> * Before RECLAIM_COMPLETE done, server should deny new lock
> */
> if (nfsd4_has_session(cstate) &&
> - !test_bit(NFSD4_CLIENT_RECLAIM_COMPLETE,
> - &cstate->session->se_client->cl_flags) &&
> + !test_bit(NFSD4_CLIENT_RECLAIM_COMPLETE, &cstate->clp->cl_flags) &&
> open->op_claim_type != NFS4_OPEN_CLAIM_PREVIOUS)
> return nfserr_grace;
>
> @@ -1882,7 +1881,7 @@ nfsd4_getdeviceinfo(struct svc_rqst *rqstp,
> nfserr = nfs_ok;
> if (gdp->gd_maxcount != 0) {
> nfserr = ops->proc_getdeviceinfo(exp->ex_path.mnt->mnt_sb,
> - rqstp, cstate->session->se_client, gdp);
> + rqstp, cstate->clp, gdp);
> }
>
> gdp->gd_notify_types &= ops->notify_types;
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index 389456937bbe..f554e3480bb1 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -3891,6 +3891,7 @@ nfsd4_reclaim_complete(struct svc_rqst *rqstp,
> struct nfsd4_compound_state *cstate, union nfsd4_op_u *u)
> {
> struct nfsd4_reclaim_complete *rc = &u->reclaim_complete;
> + struct nfs4_client *clp = cstate->clp;
> __be32 status = 0;
>
> if (rc->rca_one_fs) {
> @@ -3904,12 +3905,11 @@ nfsd4_reclaim_complete(struct svc_rqst *rqstp,
> }
>
> status = nfserr_complete_already;
> - if (test_and_set_bit(NFSD4_CLIENT_RECLAIM_COMPLETE,
> - &cstate->session->se_client->cl_flags))
> + if (test_and_set_bit(NFSD4_CLIENT_RECLAIM_COMPLETE, &clp->cl_flags))
> goto out;
>
> status = nfserr_stale_clientid;
> - if (is_client_expired(cstate->session->se_client))
> + if (is_client_expired(clp))
> /*
> * The following error isn't really legal.
> * But we only get here if the client just explicitly
> @@ -3920,8 +3920,8 @@ nfsd4_reclaim_complete(struct svc_rqst *rqstp,
> goto out;
>
> status = nfs_ok;
> - nfsd4_client_record_create(cstate->session->se_client);
> - inc_reclaim_complete(cstate->session->se_client);
> + nfsd4_client_record_create(clp);
> + inc_reclaim_complete(clp);
> out:
> return status;
> }
> @@ -5918,7 +5918,7 @@ nfsd4_test_stateid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
> {
> struct nfsd4_test_stateid *test_stateid = &u->test_stateid;
> struct nfsd4_test_stateid_id *stateid;
> - struct nfs4_client *cl = cstate->session->se_client;
> + struct nfs4_client *cl = cstate->clp;
>
> list_for_each_entry(stateid, &test_stateid->ts_stateid_list, ts_id_list)
> stateid->ts_id_status =
> @@ -5964,7 +5964,7 @@ nfsd4_free_stateid(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
> stateid_t *stateid = &free_stateid->fr_stateid;
> struct nfs4_stid *s;
> struct nfs4_delegation *dp;
> - struct nfs4_client *cl = cstate->session->se_client;
> + struct nfs4_client *cl = cstate->clp;
> __be32 ret = nfserr_bad_stateid;
>
> spin_lock(&cl->cl_lock);
> @@ -6693,7 +6693,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
> if (nfsd4_has_session(cstate))
> /* See rfc 5661 18.10.3: given clientid is ignored: */
> memcpy(&lock->lk_new_clientid,
> - &cstate->session->se_client->cl_clientid,
> + &cstate->clp->cl_clientid,
> sizeof(clientid_t));
>
> /* validate and update open stateid and open seqid */
> --
> 2.29.2
>
--
Chuck Lever
next prev parent reply other threads:[~2021-01-21 23:35 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-19 22:35 [PATCH 0/8] miscellaneous nfsd4 state cleanup J. Bruce Fields
2021-01-19 22:35 ` [PATCH 1/8] nfsd4: simplify process_lookup1 J. Bruce Fields
2021-01-19 22:35 ` [PATCH 2/8] nfsd: simplify process_lock J. Bruce Fields
2021-01-20 21:01 ` Chuck Lever
2021-01-20 21:25 ` J. Bruce Fields
2021-01-19 22:35 ` [PATCH 3/8] nfsd: simplify nfsd_renew J. Bruce Fields
2021-01-19 22:35 ` [PATCH 4/8] nfsd: refactor lookup_clientid J. Bruce Fields
2021-01-20 21:02 ` Chuck Lever
2021-01-20 23:01 ` J. Bruce Fields
2021-01-21 1:54 ` Chuck Lever
2021-01-21 18:49 ` [PATCH 1/9] nfsd4: simplify process_lookup1 J. Bruce Fields
2021-01-21 18:49 ` [PATCH 2/9] nfsd: simplify process_lock J. Bruce Fields
2021-01-21 18:49 ` [PATCH 3/9] nfsd: simplify nfsd_renew J. Bruce Fields
2021-01-21 18:49 ` [PATCH 4/9] nfsd: rename lookup_clientid->set_client J. Bruce Fields
2021-01-21 18:49 ` [PATCH 5/9] nfsd: refactor lookup_clientid J. Bruce Fields
2021-01-21 18:49 ` [PATCH 6/9] nfsd: find_cpntf_state cleanup J. Bruce Fields
2021-01-21 18:49 ` [PATCH 7/9] nfsd: remove unused set_clientid argument J. Bruce Fields
2021-01-21 20:20 ` Chuck Lever
2021-01-21 20:42 ` J. Bruce Fields
2021-01-21 22:57 ` [PATCH v3 1/9] nfsd4: simplify process_lookup1 J. Bruce Fields
2021-01-21 22:57 ` [PATCH v3 2/9] nfsd: simplify process_lock J. Bruce Fields
2021-01-21 22:57 ` [PATCH v3 3/9] nfsd: simplify nfsd_renew J. Bruce Fields
2021-01-21 22:57 ` [PATCH v3 4/9] nfsd: rename lookup_clientid->set_client J. Bruce Fields
2021-01-21 22:57 ` [PATCH v3 5/9] nfsd: refactor set_client J. Bruce Fields
2021-01-21 22:57 ` [PATCH v3 6/9] nfsd: find_cpntf_state cleanup J. Bruce Fields
2021-01-21 22:57 ` [PATCH v3 7/9] nfsd: remove unused set_client argument J. Bruce Fields
2021-01-21 22:57 ` [PATCH v3 8/9] nfsd: simplify nfsd4_check_open_reclaim J. Bruce Fields
2021-01-21 22:57 ` [PATCH v3 9/9] nfsd: cstate->session->se_client -> cstate->clp J. Bruce Fields
2021-01-21 23:34 ` Chuck Lever [this message]
2021-01-21 18:49 ` [PATCH 8/9] nfsd: simplify nfsd4_check_open_reclaim J. Bruce Fields
2021-01-21 18:49 ` [PATCH 9/9] nfsd: cstate->session->se_client -> cstate->clp J. Bruce Fields
2021-01-19 22:35 ` [PATCH 5/8] nfsd: find_cpntf_state cleanup J. Bruce Fields
2021-01-19 22:35 ` [PATCH 6/8] nfsd: remove unused set_clientid argument J. Bruce Fields
2021-01-19 22:35 ` [PATCH 7/8] nfsd: simplify nfsd4_check_open_reclaim J. Bruce Fields
2021-01-19 22:35 ` [PATCH 8/8] nfsd: cstate->session->se_client -> cstate->clp 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=E452A0A0-4015-4901-8EC5-27EB73BEEC3F@oracle.com \
--to=chuck.lever@oracle.com \
--cc=bfields@redhat.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).