aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/nfsclient/nfs_clstate.c
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2021-10-15 21:25:38 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2021-10-15 21:25:38 +0000
commit77c595ce33a37d321ef35fd840948a2e5fd17c84 (patch)
treefe7be8e32dbdf2562b0fd6024a4235beafdb5d4d /sys/fs/nfsclient/nfs_clstate.c
parent2e85df652caef859c532b7e1e8a178c75f1a4a92 (diff)
downloadsrc-77c595ce33a37d321ef35fd840948a2e5fd17c84.tar.gz
src-77c595ce33a37d321ef35fd840948a2e5fd17c84.zip
nfscl: Add an argument to nfscl_tryclose()
This patch adds a new argument to nfscl_tryclose() to indicate whether or not it should loop when a NFSERR_DELAY reply is received from the NFSv4 server. Since this new argument is always passed in as "true" at this time, no semantics change should occur. This is being done to prepare the code for a future patch that fixes the case where an NFSv4.1/4.2 server replies NFSERR_DELAY to a Close operation. MFC after: 2 week
Diffstat (limited to 'sys/fs/nfsclient/nfs_clstate.c')
-rw-r--r--sys/fs/nfsclient/nfs_clstate.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c
index 40bf5b41361a..d3ce1c6bef8b 100644
--- a/sys/fs/nfsclient/nfs_clstate.c
+++ b/sys/fs/nfsclient/nfs_clstate.c
@@ -2399,7 +2399,7 @@ nfscl_recover(struct nfsclclient *clp, bool *retokp, struct ucred *cred,
LIST_FOREACH_SAFE(op, &extra_open, nfso_list, nop) {
do {
newnfs_copycred(&op->nfso_cred, tcred);
- error = nfscl_tryclose(op, tcred, nmp, p);
+ error = nfscl_tryclose(op, tcred, nmp, p, true);
if (error == NFSERR_GRACE)
(void) nfs_catnap(PZERO, error, "nfsexcls");
} while (error == NFSERR_GRACE);
@@ -4506,24 +4506,24 @@ nfscl_trydelegreturn(struct nfscldeleg *dp, struct ucred *cred,
*/
int
nfscl_tryclose(struct nfsclopen *op, struct ucred *cred,
- struct nfsmount *nmp, NFSPROC_T *p)
+ struct nfsmount *nmp, NFSPROC_T *p, bool loop_on_delayed)
{
struct nfsrv_descript nfsd, *nd = &nfsd;
int error;
do {
error = nfsrpc_closerpc(nd, nmp, op, cred, p, 0);
- if (error == NFSERR_DELAY)
+ if (loop_on_delayed && error == NFSERR_DELAY)
(void) nfs_catnap(PZERO, error, "nfstrycl");
- } while (error == NFSERR_DELAY);
+ } while (loop_on_delayed && error == NFSERR_DELAY);
if (error == EAUTH || error == EACCES) {
/* Try again using system credentials */
newnfs_setroot(cred);
do {
error = nfsrpc_closerpc(nd, nmp, op, cred, p, 1);
- if (error == NFSERR_DELAY)
+ if (loop_on_delayed && error == NFSERR_DELAY)
(void) nfs_catnap(PZERO, error, "nfstrycl");
- } while (error == NFSERR_DELAY);
+ } while (loop_on_delayed && error == NFSERR_DELAY);
}
return (error);
}