linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: bfields@fieldses.org
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH v2 01/11] nfsd: rq_lease_breaker cleanup
Date: Tue, 29 Sep 2020 10:03:42 -0400	[thread overview]
Message-ID: <160138822239.2558.8296960298766443554.stgit@klimt.1015granger.net> (raw)
In-Reply-To: <160138785101.2558.11821923574884893011.stgit@klimt.1015granger.net>

From: J. Bruce Fields <bfields@redhat.com>

Since only the v4 code cares about it, maybe it's better to leave
rq_lease_breaker out of the common dispatch code?

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
 fs/nfsd/nfs4state.c |    3 ++-
 fs/nfsd/nfssvc.c    |    1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 767dc1b27e91..603c0a227a64 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -4601,7 +4601,8 @@ static bool nfsd_breaker_owns_lease(struct file_lock *fl)
 	if (!i_am_nfsd())
 		return NULL;
 	rqst = kthread_data(current);
-	if (!rqst->rq_lease_breaker)
+	/* Note rq_prog == NFS_ACL_PROGRAM is also possible: */
+	if (rqst->rq_prog != NFS_PROGRAM || rqst->rq_vers < 4)
 		return NULL;
 	clp = *(rqst->rq_lease_breaker);
 	return dl->dl_stid.sc_client == clp;
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index f7f6473578af..f6bc94cab9da 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -1016,7 +1016,6 @@ nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp)
 		*statp = rpc_garbage_args;
 		return 1;
 	}
-	rqstp->rq_lease_breaker = NULL;
 	/*
 	 * Give the xdr decoder a chance to change this if it wants
 	 * (necessary in the NFSv4.0 compound case)



  reply	other threads:[~2020-09-29 14:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-29 14:03 [PATCH v2 00/11] nfsd_dispatch() clean up Chuck Lever
2020-09-29 14:03 ` Chuck Lever [this message]
2020-09-29 14:03 ` [PATCH v2 02/11] lockd: Replace PROC() macro with open code Chuck Lever
2020-09-29 14:03 ` [PATCH v2 03/11] NFSACL: " Chuck Lever
2020-09-29 14:03 ` [PATCH v2 04/11] NFSD: Encoder and decoder functions are always present Chuck Lever
2020-09-29 14:04 ` [PATCH v2 05/11] NFSD: Clean up switch statement in nfsd_dispatch() Chuck Lever
2020-09-29 14:04 ` [PATCH v2 06/11] NFSD: Clean up stale comments " Chuck Lever
2020-09-29 14:04 ` [PATCH v2 07/11] NFSD: Clean up nfsd_dispatch() variables Chuck Lever
2020-09-29 14:04 ` [PATCH v2 08/11] NFSD: Refactor nfsd_dispatch() error paths Chuck Lever
2020-09-29 14:04 ` [PATCH v2 09/11] NFSD: Set *statp in success path Chuck Lever
2020-09-29 14:04 ` [PATCH v2 10/11] NFSD: Fix .pc_release method for NFSv2 Chuck Lever
2020-09-29 14:04 ` [PATCH v2 11/11] NFSD: Call NFSv2 encoders on error returns Chuck Lever
2020-09-29 15:53   ` Chuck Lever

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=160138822239.2558.8296960298766443554.stgit@klimt.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=bfields@fieldses.org \
    --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).