git: 8ca2474ce604 - stable/12 - nfscl: Check for a forced dismount in nfscl_getref()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 17 Nov 2021 01:42:50 UTC
The branch stable/12 has been updated by rmacklem:
URL: https://cgit.FreeBSD.org/src/commit/?id=8ca2474ce6043d1536591495a0969a48df72a5cd
commit 8ca2474ce6043d1536591495a0969a48df72a5cd
Author: Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2021-11-03 00:28:13 +0000
Commit: Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2021-11-17 01:39:46 +0000
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.
(cherry picked from commit 331883a2f2e9ae5567085e4cd3a7ae3db2a2b022)
---
sys/fs/nfsclient/nfs_clstate.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c
index 5f35e4e708e9..dd4eae5a0d2d 100644
--- a/sys/fs/nfsclient/nfs_clstate.c
+++ b/sys/fs/nfsclient/nfs_clstate.c
@@ -4707,6 +4707,7 @@ int
nfscl_getref(struct nfsmount *nmp)
{
struct nfsclclient *clp;
+ int ret;
NFSLOCKCLSTATE();
clp = nfscl_findcl(nmp);
@@ -4714,9 +4715,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);
}
/*