git: 1bdf879b97b6 - main - fusefs: fix some resource leaks
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 14 Feb 2023 21:21:06 UTC
The branch main has been updated by asomers:
URL: https://cgit.FreeBSD.org/src/commit/?id=1bdf879b97b686a8f36fdba050b68f9e7493f363
commit 1bdf879b97b686a8f36fdba050b68f9e7493f363
Author: Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2023-02-11 23:43:30 +0000
Commit: Alan Somers <asomers@FreeBSD.org>
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);