From nobody Tue Oct 17 16:41:41 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4S909y2zbGz4xkD5; Tue, 17 Oct 2023 16:41:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S909y0nM3z4QnX; Tue, 17 Oct 2023 16:41:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697560902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y/U6g+h+mdm6Sty58ElnRDHg0+nMgNM66JT04PlRe5c=; b=RBOUjRJpyKeMqg3W4TIwtsCRwpFWDZgGlp3N2hwvr2QUaxz6zQiOHtK3d1FM/nTxKs5oRh JfAgRO8WxPNAuzEHNJgGW1g8556RQfsqZDIki4OxXneUOztY/5+3KL1kU29fH5POQ6yWUm TK8xUtMxm5CEhZ5s2/fMWRyECinHgsP4wTSExWJw/6Z+DgeGiin8iYQrCmYWW8dDjVflAq mwnBypEgLw0VnGXNM+GQwWe46J6MQNhGEzEtn5LoT/Ew6g6DkEmgPCTvG3IokBdhnGEuET u+sf6sUB+WmltvC5TA1v+03naTvc44W2p9Lyd1sCDLsuMYR+R30oCNqC7xz/vA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697560902; a=rsa-sha256; cv=none; b=k52NQZdFj9GWfGVFsJCMiJXoDLQblyd7yUi6TaCVKD+1GPvu/UwYqzfYgQAL+idSnnYuXk A6Ps7KputIUfUtXWqc14XmBWaYhyjzzqunVpD3Is3KM3iJa43dFIFkiVxovPbf6tXK3AIS 8TjcJn47Au6exa7Ib1vxwkkpUHNePI+Bq8syHe3V2BXA269ifu62Wlxu1KPguOC7ACol1M 9hyY8SxASYYRrvp0NNdUZ0+M54c/DkJTTojvc8vav8thG9cG7cH/dIBxqhMtfFUfK9Jj1v JfMFzDPrlpQhpY0ZIZnW9aWzk/Nu9CxifGM2LZHs34qiWhgTwEDqLU03sBxayQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697560902; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y/U6g+h+mdm6Sty58ElnRDHg0+nMgNM66JT04PlRe5c=; b=mQluodW+pAF5nylpyblaDolJ5nI3QwmR+69sDGeg1ouF48UQzwVOjxfE7TJF3FPjfgDpM7 /PB+Jn3Pk7Z6eqnU3Qhq0N79warFD7ci8xCYIMd7iIQOXG7UYfEZivT2h3RbX/p8wc6X1N lJOD5vV3VIeCa8mZ+QPVF9UZGmO2zClCrfFEo7R7gZ5xG8ZGDme/kKH39rOZipAxJhb+u3 NIETEt8k9tvBGQni1+prsQ/hqud9MflcWuwH7Vc8esbCJogPV+tMrpGX98JOp+F3hnVdRS XC4H1DO1Uze8ufKilX+BoVUPOgWCMIHpKeksMlRzjoexacwLLfaGtgnzLfQUCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4S909x6mZJzXFj; Tue, 17 Oct 2023 16:41:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39HGffTB010003; Tue, 17 Oct 2023 16:41:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39HGffnj010000; Tue, 17 Oct 2023 16:41:41 GMT (envelope-from git) Date: Tue, 17 Oct 2023 16:41:41 GMT Message-Id: <202310171641.39HGffnj010000@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 56c44bd92efa - main - automount(8): when flushing autofs, specify fsid List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 56c44bd92efa002b2185445878fc98172ae8c66f Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=56c44bd92efa002b2185445878fc98172ae8c66f commit 56c44bd92efa002b2185445878fc98172ae8c66f Author: Konstantin Belousov AuthorDate: 2023-09-29 18:43:42 +0000 Commit: Konstantin Belousov CommitDate: 2023-10-17 16:40:50 +0000 automount(8): when flushing autofs, specify fsid Which should avoid situation where flushed filesystem is not autofs, because it was mounted over autofs mp. Reported and tested by: Andrew "RhodiumToad" Gierth PR: 272446 Reviewed by: mjg Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D42023 --- usr.sbin/autofs/automount.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.sbin/autofs/automount.c b/usr.sbin/autofs/automount.c index cee647cb4e2c..6637e16c9129 100644 --- a/usr.sbin/autofs/automount.c +++ b/usr.sbin/autofs/automount.c @@ -229,7 +229,7 @@ mount_unmount(struct node *root) } static void -flush_autofs(const char *fspath) +flush_autofs(const char *fspath, const fsid_t *fsid) { struct iovec *iov = NULL; char errmsg[255]; @@ -242,6 +242,8 @@ flush_autofs(const char *fspath) __DECONST(void *, "autofs"), (size_t)-1); build_iovec(&iov, &iovlen, "fspath", __DECONST(void *, fspath), (size_t)-1); + build_iovec(&iov, &iovlen, "fsid", + __DECONST(void *, fsid), sizeof(*fsid)); build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); @@ -291,7 +293,7 @@ flush_caches(void) continue; } - flush_autofs(mntbuf[i].f_mntonname); + flush_autofs(mntbuf[i].f_mntonname, &statbuf.f_fsid); } }