From nobody Tue Feb 14 21:21:06 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 4PGYzR26wqz3q1Hd; Tue, 14 Feb 2023 21:21:07 +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 4PGYzR1g0bz44qF; Tue, 14 Feb 2023 21:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676409667; 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=xdX9U6cSLYwSKNSoWvtXD6Vow9fuldcUOrXl/W20UKU=; b=NT8OSmo3bpd48oQtoTOnShvTac6yXAs/givuSYC1ItMpSuLJBe3olY/oIxQkpBszHym/M8 YcAy//vWx8cFtUYpVKrSXZcZ5cDde18QW10gSV0EIG4/KXbXymxnKeB3aFRrgQTkvCeZK9 NvN0WKmmJ0tiPIiyWLIdjsRYZCrG3uWppoeSD3Kk/PF1s8HV/RrYHv75SuTOvlX+IeNk7D Cj8QEo5kjdDaJvVp4nuYcgHs6wfnUwJr98prUIXFdzollh2U8GqLGOeZ5K21sg3U2hyo0t iNzbOnGmMbbkTvwQ/gtlEs8mcdsI7ODhdyb5hZk3km0y0MZro2Olqnt/wB/Pow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676409667; 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=xdX9U6cSLYwSKNSoWvtXD6Vow9fuldcUOrXl/W20UKU=; b=Y5zmDEkzk7L7w8yZ5GzOI27i/tf8GdN2+qp5r5kZ1KnTbMZr5sKmY0qQm9fm6ULZrXQxEP gYhzxoWnRfIX3SXSOFAkSMt9+tzbtcPtk2uhN1hfHP8/xVXos8uBVX+pXDA/Nm6NT4SOH/ zrItt5BOsDqQp62P3bjHx5OSVdDqWldVTnbLgbOcgLfWD8s4iHEccSNt589Wl/1Esb2WPD foUNT0MQY8JIpzPwg4mGgB/ADXQsgLgDswc+nqTg08FCZjG3T9XMANHQ8BsaysDB+zgHwm DauScNOEC2s46ytFshEArFW4Dk10L/f/90dWYrB1k8xlUAIeSnWQgPkB2uenHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676409667; a=rsa-sha256; cv=none; b=sfX4v8XIhr+GAwFqF0nMfCpuctEcCWokNLK8DLAXlowBmaWmK1bazNFi+MO1OusqIXrrJ0 U8VHvm8LxSrUfAybwKAB5L2o3JXK3dhvZKYT9Eq+AEsMscyxgZL16PYn5IgPjkwr80Vgvm ubAIzwh7N/1Zkgo+TsEQPut+n1rp41nyileLoPuGrQjCsdicUBGvbUa3sVgLS4+Zb+sXhp myrpAbv226r1KmNT1qkFWCOvIT2nxN3wdU/53fCXFRaYvxrRLlVYTNWj1G0UgdvhSeJS/g PsCqBo0NPla75808HduB3GRHx5Z83EyfMf9zfQw/zxsHcU3TiLW4kJ+vcB33dg== 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 4PGYzR0jQhz1DLb; Tue, 14 Feb 2023 21:21:07 +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 31ELL7Sb041981; Tue, 14 Feb 2023 21:21:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31ELL6Cx041980; Tue, 14 Feb 2023 21:21:06 GMT (envelope-from git) Date: Tue, 14 Feb 2023 21:21:06 GMT Message-Id: <202302142121.31ELL6Cx041980@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 1bdf879b97b6 - main - fusefs: fix some resource leaks 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: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1bdf879b97b686a8f36fdba050b68f9e7493f363 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=1bdf879b97b686a8f36fdba050b68f9e7493f363 commit 1bdf879b97b686a8f36fdba050b68f9e7493f363 Author: Alan Somers AuthorDate: 2023-02-11 23:43:30 +0000 Commit: Alan Somers CommitDate: 2023-02-14 21:19:59 +0000 fusefs: fix some resource leaks fusefs would leak tickets in three cases: * After FUSE_CREATE, if the server returned a bad inode number. * After a FUSE_FALLOCATE operation during VOP_ALLOCATE * After a FUSE_FALLOCATE operation during VOP_DEALLOCATE MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38526 --- sys/fs/fuse/fuse_vnops.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index a088fe318d81..f97a1a52eaad 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -667,6 +667,7 @@ fuse_vnop_allocate(struct vop_allocate_args *ap) } } + fdisp_destroy(&fdi); return (err); } @@ -1103,6 +1104,7 @@ fuse_vnop_create(struct vop_create_args *ap) uint64_t nodeid = feo->nodeid; uint64_t fh_id = foo->fh; + fdisp_destroy(fdip); fdisp_init(fdip, sizeof(*fri)); fdisp_make(fdip, FUSE_RELEASE, mp, nodeid, td, cred); fri = fdip->indata; @@ -3021,6 +3023,7 @@ fuse_vnop_deallocate(struct vop_deallocate_args *ap) err = fdisp_wait_answ(&fdi); if (err == ENOSYS) { + fdisp_destroy(&fdi); fsess_set_notimpl(mp, FUSE_FALLOCATE); goto fallback; } else if (err == EOPNOTSUPP) { @@ -3028,6 +3031,7 @@ fuse_vnop_deallocate(struct vop_deallocate_args *ap) * The file system server does not support FUSE_FALLOCATE with * the supplied mode for this particular file. */ + fdisp_destroy(&fdi); goto fallback; } else if (!err) { /* @@ -3047,6 +3051,7 @@ fuse_vnop_deallocate(struct vop_deallocate_args *ap) } out: + fdisp_destroy(&fdi); if (closefufh) fuse_filehandle_close(vp, fufh, curthread, cred);