aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2021-11-03 21:25:44 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2021-11-17 01:33:19 +0000
commit00e9bc2d937fd8de6638c4a5669e78f04cd94110 (patch)
treebc5f7e545be5ed61ca7c48eeb436ef858c7af863
parent09f907eb0cc009a83b47225bf18222237b34aa44 (diff)
nfscl: Fix forced dismount from looping on commit
When a forced dismount is in progress, it is possible to end up looping, retrying commits that fail. This patch fixes the problem by pretending that commits succeeded when a forced dismount is in prgress. (cherry picked from commit 6b67753488cb506f05694c5f6d2e74cf53497c54)
-rw-r--r--sys/fs/nfsclient/nfs_clbio.c2
-rw-r--r--sys/fs/nfsclient/nfs_clvnops.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c
index c61cb1db9b95..52eb879caafb 100644
--- a/sys/fs/nfsclient/nfs_clbio.c
+++ b/sys/fs/nfsclient/nfs_clbio.c
@@ -1726,7 +1726,7 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td,
off = ((u_quad_t)bp->b_blkno) * DEV_BSIZE + bp->b_dirtyoff;
retv = ncl_commit(vp, off, bp->b_dirtyend-bp->b_dirtyoff,
bp->b_wcred, td);
- if (retv == 0) {
+ if (NFSCL_FORCEDISM(vp->v_mount) || retv == 0) {
bp->b_dirtyoff = bp->b_dirtyend = 0;
bp->b_flags &= ~(B_NEEDCOMMIT | B_CLUSTEROK);
bp->b_resid = 0;
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c
index 17859a16424b..ffa8e41ec578 100644
--- a/sys/fs/nfsclient/nfs_clvnops.c
+++ b/sys/fs/nfsclient/nfs_clvnops.c
@@ -2934,7 +2934,7 @@ again:
for (i = 0; i < bvecpos; i++) {
bp = bvec[i];
bp->b_flags &= ~(B_NEEDCOMMIT | B_CLUSTEROK);
- if (retv) {
+ if (!NFSCL_FORCEDISM(vp->v_mount) && retv) {
/*
* Error, leave B_DELWRI intact
*/