[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 086/111] Virtiofsd: fix memory leak on fuse queueinfo
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PULL 086/111] Virtiofsd: fix memory leak on fuse queueinfo |
Date: |
Thu, 23 Jan 2020 11:58:16 +0000 |
From: Liu Bo <address@hidden>
For fuse's queueinfo, both queueinfo array and queueinfos are allocated in
fv_queue_set_started() but not cleaned up when the daemon process quits.
This fixes the leak in proper places.
Signed-off-by: Liu Bo <address@hidden>
Signed-off-by: Eric Ren <address@hidden>
Reviewed-by: Misono Tomohiro <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
---
tools/virtiofsd/fuse_virtio.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c
index b7948def27..fb8d6d1379 100644
--- a/tools/virtiofsd/fuse_virtio.c
+++ b/tools/virtiofsd/fuse_virtio.c
@@ -625,6 +625,8 @@ static void fv_queue_cleanup_thread(struct fv_VuDev *vud,
int qidx)
}
close(ourqi->kill_fd);
ourqi->kick_fd = -1;
+ free(vud->qi[qidx]);
+ vud->qi[qidx] = NULL;
}
/* Callback from libvhost-user on start or stop of a queue */
@@ -884,6 +886,12 @@ int virtio_session_mount(struct fuse_session *se)
void virtio_session_close(struct fuse_session *se)
{
close(se->vu_socketfd);
+
+ if (!se->virtio_dev) {
+ return;
+ }
+
+ free(se->virtio_dev->qi);
free(se->virtio_dev);
se->virtio_dev = NULL;
}
--
2.24.1
- [PULL 077/111] virtiofsd: Clean up inodes on destroy, (continued)
- [PULL 077/111] virtiofsd: Clean up inodes on destroy, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 080/111] virtiofsd: cleanup allocated resource in se, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 081/111] virtiofsd: fix memory leak on lo.source, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 079/111] virtiofsd: fix error handling in main(), Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 078/111] virtiofsd: support nanosecond resolution for file timestamp, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 082/111] virtiofsd: add helper for lo_data cleanup, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 090/111] virtiofsd: make lo_release() atomic, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 089/111] virtiofsd: prevent fv_queue_thread() vs virtio_loop() races, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 074/111] virtiofsd: extract root inode init into setup_root(), Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 091/111] virtiofsd: prevent races with lo_dirp_put(), Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 086/111] Virtiofsd: fix memory leak on fuse queueinfo,
Dr. David Alan Gilbert (git) <=
- [PULL 095/111] virtiofsd: passthrough_ll: fix refcounting on remove/rename, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 101/111] virtiofsd: passthrough_ll: Use cache_readdir for directory open, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 107/111] virtiofsd: add --thread-pool-size=NUM option, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 088/111] virtiofsd: use fuse_lowlevel_is_virtio() in fuse_session_destroy(), Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 087/111] virtiofsd: Support remote posix locks, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 083/111] virtiofsd: Prevent multiply running with same vhost_user_socket, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 085/111] virtiofsd: fix incorrect error handling in lo_do_lookup, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 071/111] virtiofsd: passthrough_ll: control readdirplus, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 084/111] virtiofsd: enable PARALLEL_DIROPS during INIT, Dr. David Alan Gilbert (git), 2020/01/23
- [PULL 093/111] libvhost-user: Fix some memtable remap cases, Dr. David Alan Gilbert (git), 2020/01/23