summaryrefslogtreecommitdiffstats
path: root/sys/fs/nfs/nfs_commonsubs.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs/nfs/nfs_commonsubs.c')
-rw-r--r--sys/fs/nfs/nfs_commonsubs.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c
index b60b0eb..0ee06bd 100644
--- a/sys/fs/nfs/nfs_commonsubs.c
+++ b/sys/fs/nfs/nfs_commonsubs.c
@@ -3693,8 +3693,8 @@ nfsv4_seqsess_cacherep(uint32_t slotid, struct nfsslot *slots, struct mbuf *rep)
* Generate the xdr for an NFSv4.1 Sequence Operation.
*/
APPLESTATIC void
-nfsv4_setsequence(struct nfsrv_descript *nd, struct nfsclsession *sep,
- int dont_replycache)
+nfsv4_setsequence(struct nfsmount *nmp, struct nfsrv_descript *nd,
+ struct nfsclsession *sep, int dont_replycache)
{
uint32_t *tl, slotseq = 0;
int i, maxslot, slotpos;
@@ -3717,9 +3717,21 @@ nfsv4_setsequence(struct nfsrv_descript *nd, struct nfsclsession *sep,
}
bitval <<= 1;
}
- if (slotpos == -1)
+ if (slotpos == -1) {
+ /*
+ * If a forced dismount is in progress, just return.
+ * This RPC attempt will fail when it calls
+ * newnfs_request().
+ */
+ if ((nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF)
+ != 0) {
+ mtx_unlock(&sep->nfsess_mtx);
+ return;
+ }
+ /* Wake up once/sec, to check for a forced dismount. */
(void)mtx_sleep(&sep->nfsess_slots, &sep->nfsess_mtx,
- PZERO, "nfsclseq", 0);
+ PZERO, "nfsclseq", hz);
+ }
} while (slotpos == -1);
/* Now, find the highest slot in use. (nfsc_slots is 64bits) */
bitval = 1;
OpenPOWER on IntegriCloud