From nobody Wed Jul 06 12:33:49 2022 X-Original-To: dev-commits-src-all@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 DEABE1D100F6; Wed, 6 Jul 2022 12:33:49 +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 4LdJqx5klKz3tZ2; Wed, 6 Jul 2022 12:33:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657110829; 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=lJ8JyYNPfE8rZzBKPDHcLxgahaxg2w+MXRmPhGk2VDA=; b=bgJTe8D/aUGnbzJDLTlLHEqGA1pW4koavrOroYsg54INMAeVXk9wjBb2wKzQWVs3v/JNZ5 EywNuw0TdVuBNPQrxVTbkKwTxbCmcS85FcRWD9/vM2aqJntvzWbEu8znMRPDpW2zGyDpjh 3EYEZFvDOk9upIkwX2GKXxgGoqGIi4lkobFABeJ1nWUG7dxuQN7HYke97khgz6MC/GoQeA pD1m0PSJnUvUhumgkluzShkxyj7M38Yr1c+tyRFnEiUdRojL9OU5VjMiSFL342pi66FW4N j80+GalT9FZEVNH3cBU3xCEXt1OGfe0fuJHelUObM5ulX9dvDpen7bGvoyg0Jg== 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 A4FDB1A997; Wed, 6 Jul 2022 12:33:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 266CXnPT017849; Wed, 6 Jul 2022 12:33:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 266CXnVk017848; Wed, 6 Jul 2022 12:33:49 GMT (envelope-from git) Date: Wed, 6 Jul 2022 12:33:49 GMT Message-Id: <202207061233.266CXnVk017848@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 96251798e010 - stable/13 - vfs_op_exit(): assert that mnt_vfs_ops stays non-zero for unmount or suspend List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 96251798e0100e46990d90e25917fb1dac6acce6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657110829; 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=lJ8JyYNPfE8rZzBKPDHcLxgahaxg2w+MXRmPhGk2VDA=; b=LqhojWnWd3OG9k5KvxMosAmSVVw8uZf8+9OqHF+iN4wY8eC9QvVLpCdZ6+s18P2fcZb6la WIA/jOzoz04cxgkiQ0YImGQXlGzsZoPjMdfbAG19xo+Jn0Fw6VfMIUKKCy+wzdfTKDjxyM 4SvIpcKSIqf7pGMdzX4sfEd82lPqrRfCbdkjFGCW2T4TE7mtfiHTBdKG/l/P8tSzKXiPKA 81/OXX2afDHIz2+4Nz3S0ftpSDHGFBSibLDnXLgSi/71+nCArxMrzxBypo2C5uPzS4WoOk rvAI420lK6V73FsPdZavDs5AyNagmdB/RK40SFdRTNVyYod4xj3qDjqwUrmYQA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657110829; a=rsa-sha256; cv=none; b=TrYqlYi01bprtNrGeD9NKjFNmJx11tSpQr0Eb87DGtA/o4hfWzZhX/nKd6s24enCU6ni49 IQu8YHFjDT12MyKyW4s/m5yenFPHsPFGcpW4OjZTedZe1uWRkMyY7QSaF8hDp9mSEHYZQ4 XpiNI+ByhlmgETmKIG1ttAsdqtwSF3TgwTaz+qGyxbz1aBnlXePpZBKp/runRT3VYcB1Wt IX/0KaWpNshG0HxQxJDtpYBm8rxyo6XWZxQLudA55u0DjBhlGJ+Q3BWZAN1z4ZDbhDOTZ6 EFfzdrNJK+XGEPGFCeKjnf+cPqd8GLtT7pIB7UCW+DE5Maysl2Oos7UWGwqoDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=96251798e0100e46990d90e25917fb1dac6acce6 commit 96251798e0100e46990d90e25917fb1dac6acce6 Author: Konstantin Belousov AuthorDate: 2022-06-20 15:54:44 +0000 Commit: Konstantin Belousov CommitDate: 2022-07-06 12:33:30 +0000 vfs_op_exit(): assert that mnt_vfs_ops stays non-zero for unmount or suspend (cherry picked from commit 1e54362824f62a9d43585e94422d1d3d5f0268f9) --- sys/kern/vfs_mount.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index fa567361ae85..e14b1e882501 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -1605,6 +1605,10 @@ vfs_op_exit_locked(struct mount *mp) if (mp->mnt_vfs_ops <= 0) panic("%s: invalid vfs_ops count %d for mp %p\n", __func__, mp->mnt_vfs_ops, mp); + KASSERT(mp->mnt_vfs_ops > 1 || + (mp->mnt_kern_flag & (MNTK_UNMOUNT | MNTK_SUSPEND)) == 0, + ("%s: vfs_ops too low (%d) for mp %p in unmount or suspend", + __func__, mp->mnt_vfs_ops, mp)); mp->mnt_vfs_ops--; }