nfscl: Check for a forced dismount in nfscl_getref()

The nfscl_getref() function is called within nfscl_doiods() when
the NFSv4.1/4.2 pNFS client is doing I/O on a DS.  As such,
nfscl_getref() needs to check for a forced dismount.
This patch adds that check.

Found during a recent IETF NFSv4 working group testing event.

MFC after:	2 weeks
This commit is contained in:
Rick Macklem 2021-11-02 17:28:13 -07:00
parent edfbbfd541
commit 331883a2f2

View File

@ -4907,6 +4907,7 @@ int
nfscl_getref(struct nfsmount *nmp)
{
struct nfsclclient *clp;
int ret;
NFSLOCKCLSTATE();
clp = nfscl_findcl(nmp);
@ -4914,9 +4915,12 @@ nfscl_getref(struct nfsmount *nmp)
NFSUNLOCKCLSTATE();
return (0);
}
nfsv4_getref(&clp->nfsc_lock, NULL, NFSCLSTATEMUTEXPTR, NULL);
nfsv4_getref(&clp->nfsc_lock, NULL, NFSCLSTATEMUTEXPTR, nmp->nm_mountp);
ret = 1;
if (NFSCL_FORCEDISM(nmp->nm_mountp))
ret = 0;
NFSUNLOCKCLSTATE();
return (1);
return (ret);
}
/*