From nobody Thu Jan 25 04:32:12 2024 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 4TL7G51Dm5z57gY4; Thu, 25 Jan 2024 04:32:13 +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 4TL7G43PQLz4RSQ; Thu, 25 Jan 2024 04:32:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706157132; 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=RNL1w91eyhISOg2b74gP/WFTSxdWS71UTE8X4czWMhg=; b=sMgZaVJZsWVBUMyDep1ocaMrutyTTyvZPSTT/kr68MuakBhLaum7JBSIAYohCNihdtJVbX WMMwxCDJsBA3gXo36aCbvYfT17dvrz/dnLA98T7uxGmiR3Te6Mqdg66AKwzXXvFKFsHf9B z5WVa3P6OJjHGi0ZnQwGjWHZsdOO1Q5rqSh5zNRh3LiiJjv7Jt+UWh1ucQ9U128SWEbyDL KnHlfiUtdbMDOu2kgbuthARRssDoVNUjZHBglhquRnEkRH4m35vVA7W1qWkbHzHIriawWL Re3AHXLYxfJxQzocQCsBFWehqPtKMG2VaWrEmz70us0zSSjpqeTsvM+IbWfriw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706157132; 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=RNL1w91eyhISOg2b74gP/WFTSxdWS71UTE8X4czWMhg=; b=JXA5gXISzZOs+Pv5y+jpo+dsDomDnLu2eCsNZ5bjSmYNwd0W47LMBeN+v6BeZXPNCzZcp2 S4GEZ4X66TSK5fcDlDTAwHTnGhBtJDe+nKnLWX7TTKp2Ki3KGwj7pPX+kIuJQSQZkHg5NT wNuJ9WMLBKYC40GDyE18TlA+ZyZ4QaJY/hI/PDuDEfg9LRVW8KsjaSNtfGLkWZkTpJR8FF rHP9Nq44DvE3watjKWsxZVkHpHLUPx3KF1DmMw6sVOjbi1EeXt4aEXlwjygVauhxoL+a36 r0Qpiw4UGSroiV6QAOivnbJHaUpISTlBmKKGTL3y2dEc41m2unTpzgaRcXBfag== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706157132; a=rsa-sha256; cv=none; b=ZRA9/ax11pVtxbX5rnN4WJkPhvew9s7krsHI37U9/IsLurmk9Z09YtVq72SHkz+L2d/3/m eQwGsP94PuL2g/fUD0TdIa/P9T3eCHpUbpytMM90Aw/02CzFwApXkiaQJqa+GpR2OKaMpX ihMIpl9C56kvnf10HjD3n9pMOyA/f1QFO9FvDfyHfokSpdVvt2CV3aOy0og8LE/ms8AxsJ oVNn54DcLBpQH8BjpM+iq/kF5E8wu4iEKMGvmmJFKAvsz4WvuGTmzG0r4Yxwt8WHIVt7yv MN5mhrpYFykTcNoq12v8Yk5oW7Q1NXKOMhiaI5LpyAIja+ACIp+tKOZzLkzDYA== 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 4TL7G423z0zkHQ; Thu, 25 Jan 2024 04:32:12 +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 40P4WCxC092521; Thu, 25 Jan 2024 04:32:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40P4WC67092518; Thu, 25 Jan 2024 04:32:12 GMT (envelope-from git) Date: Thu, 25 Jan 2024 04:32:12 GMT Message-Id: <202401250432.40P4WC67092518@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: e45f10165847 - stable/13 - msdosfs_integrity_error(): plug possible busy leak 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: e45f10165847baf419dbec40d0f10c0b2864442f Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e45f10165847baf419dbec40d0f10c0b2864442f commit e45f10165847baf419dbec40d0f10c0b2864442f Author: Konstantin Belousov AuthorDate: 2024-01-18 15:35:56 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-24 13:04:38 +0000 msdosfs_integrity_error(): plug possible busy leak (cherry picked from commit 13ccb04589e2c5c840e19b407a59e44cb70ac28e) --- sys/fs/msdosfs/msdosfs_vfsops.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index 73082976ec46..fe367122b3e3 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -1008,7 +1008,9 @@ msdosfs_remount_ro(void *arg, int pending) } MSDOSFS_UNLOCK_MP(pmp); - vfs_unbusy(pmp->pm_mountp); + do { + vfs_unbusy(pmp->pm_mountp); + } while (--pending >= 0); } void @@ -1017,11 +1019,19 @@ msdosfs_integrity_error(struct msdosfsmount *pmp) int error; error = vfs_busy(pmp->pm_mountp, MBF_NOWAIT); - if (error == 0) - taskqueue_enqueue(taskqueue_thread, &pmp->pm_rw2ro_task); - else + if (error == 0) { + error = taskqueue_enqueue(taskqueue_thread, + &pmp->pm_rw2ro_task); + if (error != 0) { + printf("%s: integrity error scheduling failed, " + "error %d\n", + pmp->pm_mountp->mnt_stat.f_mntfromname, error); + vfs_unbusy(pmp->pm_mountp); + } + } else { printf("%s: integrity error busying failed, error %d\n", pmp->pm_mountp->mnt_stat.f_mntfromname, error); + } } static int