nfsd: check fl_lmops in nfsd_breaker_owns_lease()

Any lease created by nfsd will have its fl_lmops set to
nfsd_lease_mng_ops. Do a quick check for that first when testing whether
the lease breaker owns the lease.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Acked-by: Chuck Lever <chuck.lever@oracle.com>
Link: https://patch.msgid.link/20260616-dir-deleg-v7-1-6cbc7eac0ade@kernel.org
Signed-off-by: Chuck Lever <cel@kernel.org>
This commit is contained in:
Jeff Layton
2026-06-16 07:58:44 -04:00
committed by Chuck Lever
parent b9060689f4
commit b8e7df3f3a

View File

@@ -91,6 +91,8 @@ static void _free_cpntf_state_locked(struct nfsd_net *nn, struct nfs4_cpntf_stat
static void nfsd4_file_hash_remove(struct nfs4_file *fi);
static void deleg_reaper(struct nfsd_net *nn);
static const struct lease_manager_operations nfsd_lease_mng_ops;
/* Locking: */
enum nfsd4_st_mutex_lock_subclass {
@@ -5748,6 +5750,10 @@ static bool nfsd_breaker_owns_lease(struct file_lease *fl)
struct svc_rqst *rqst;
struct nfs4_client *clp;
/* Only nfsd leases */
if (fl->fl_lmops != &nfsd_lease_mng_ops)
return false;
rqst = nfsd_current_rqst();
if (!nfsd_v4client(rqst))
return false;