Date: Tue, 11 Aug 2026 11:05:58 +0000 From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 0484b6a01a0e - stable/15 - autofs: try to avoid waiting for timeouts of in-flight requests for forced unmounts Message-ID: <6a7b0216.3fcab.836379@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0484b6a01a0e4eab1c77f7fb7c65eb64ad5dd408 commit 0484b6a01a0e4eab1c77f7fb7c65eb64ad5dd408 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2026-08-04 06:26:56 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2026-08-11 11:00:02 +0000 autofs: try to avoid waiting for timeouts of in-flight requests for forced unmounts (cherry picked from commit d3c3a705b5e6689798057b764713bfc0e3b69f6a) --- sys/fs/autofs/autofs_vfsops.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/sys/fs/autofs/autofs_vfsops.c b/sys/fs/autofs/autofs_vfsops.c index 473a0b2280ac..3da9909b6c3e 100644 --- a/sys/fs/autofs/autofs_vfsops.c +++ b/sys/fs/autofs/autofs_vfsops.c @@ -109,6 +109,33 @@ autofs_mount(struct mount *mp) return (0); } +/* + * Try to abort any requests currently in flight. This is not + * strictly necessary, the strong pass is done after all vnodes are + * reclaimed, and does not prevent new requests from queueing. But + * doing it now should practically avoid waiting for timeouts because + * each in-flight requests busies the mount point, which makes + * unmount() to wait for it to drain. + */ +static void +autofs_purge(struct mount *mp) +{ + struct autofs_mount *amp; + struct autofs_request *ar; + + amp = VFSTOAUTOFS(mp); + sx_xlock(&autofs_softc->sc_lock); + TAILQ_FOREACH(ar, &autofs_softc->sc_requests, ar_next) { + if (ar->ar_mount != amp) + continue; + ar->ar_error = ENXIO; + ar->ar_done = true; + ar->ar_in_progress = false; + } + sx_xunlock(&autofs_softc->sc_lock); + cv_broadcast(&autofs_softc->sc_cv); +} + static int autofs_unmount(struct mount *mp, int mntflags) { @@ -208,6 +235,7 @@ static struct vfsops autofs_vfsops = { .vfs_fhtovp = NULL, /* XXX */ .vfs_mount = autofs_mount, .vfs_unmount = autofs_unmount, + .vfs_purge = autofs_purge, .vfs_root = autofs_root, .vfs_statfs = autofs_statfs, .vfs_init = autofs_init,home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a7b0216.3fcab.836379>
