Date: Wed, 17 Nov 2021 01:28:55 GMT From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 19f780169c43 - stable/13 - nfscl: Fix forced dismount from looping on commit Message-ID: <202111170128.1AH1St4d039570@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=19f780169c43f017f4786ccf0b6f9a4637bd2c31 commit 19f780169c43f017f4786ccf0b6f9a4637bd2c31 Author: Rick Macklem <rmacklem@FreeBSD.org> AuthorDate: 2021-11-03 21:25:44 +0000 Commit: Rick Macklem <rmacklem@FreeBSD.org> CommitDate: 2021-11-17 01:25:29 +0000 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) --- sys/fs/nfsclient/nfs_clbio.c | 2 +- sys/fs/nfsclient/nfs_clvnops.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index 250d01d88948..73f559ad82f8 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -1738,7 +1738,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 eab6eed82830..cd8077e243ea 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -3045,7 +3045,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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202111170128.1AH1St4d039570>