Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Aug 2021 20:18:35 GMT
From:      "Jason A. Harmening" <jah@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: e81e71b0e9cb - main - Use interruptible wait for blocking recursive unmounts
Message-ID:  <202108202018.17KKIZPW075273@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jah:

URL: https://cgit.FreeBSD.org/src/commit/?id=e81e71b0e9cbb5515ffb31bf80088fd7b20e7994

commit e81e71b0e9cbb5515ffb31bf80088fd7b20e7994
Author:     Jason A. Harmening <jah@FreeBSD.org>
AuthorDate: 2021-08-08 05:31:02 +0000
Commit:     Jason A. Harmening <jah@FreeBSD.org>
CommitDate: 2021-08-20 20:21:56 +0000

    Use interruptible wait for blocking recursive unmounts
    
    Now that we allow recursive unmount attempts to be abandoned upon
    exceeding the retry limit, we should avoid leaving an unkillable
    thread when a synchronous unmount request was issued against the
    base filesystem.
    
    Reviewed by:    kib (earlier revision), mkusick
    Differential Revision:  https://reviews.freebsd.org/D31450
---
 sys/kern/vfs_mount.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 0fb5694ebed5..166d7336eaf1 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -2084,10 +2084,15 @@ dounmount(struct mount *mp, uint64_t flags, struct thread *td)
 		 * just re-enqueue on the end of the taskqueue.
 		 */
 		if ((flags & MNT_DEFERRED) == 0) {
-			while (!TAILQ_EMPTY(&mp->mnt_uppers)) {
+			while (error == 0 && !TAILQ_EMPTY(&mp->mnt_uppers)) {
 				mp->mnt_kern_flag |= MNTK_TASKQUEUE_WAITER;
-				msleep(&mp->mnt_taskqueue_link, MNT_MTX(mp), 0,
-				    "umntqw", 0);
+				error = msleep(&mp->mnt_taskqueue_link,
+				    MNT_MTX(mp), PCATCH, "umntqw", 0);
+			}
+			if (error != 0) {
+				MNT_REL(mp);
+				MNT_IUNLOCK(mp);
+				return (error);
 			}
 		} else if (!TAILQ_EMPTY(&mp->mnt_uppers)) {
 			MNT_IUNLOCK(mp);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108202018.17KKIZPW075273>