diff --git a/qtfs/qtfs/qtfs-mod.c b/qtfs/qtfs/qtfs-mod.c index e4fb9044f1d60acadd46501bb12e00655bf06f2c..e2648cd24880c14a0a5e66c55a8bcf2e1a2ef2c1 100644 --- a/qtfs/qtfs/qtfs-mod.c +++ b/qtfs/qtfs/qtfs-mod.c @@ -221,6 +221,7 @@ static int __init qtfs_init(void) ret = -ENOMEM; goto cache_create_err; } + qtfs_whitelist_initset(); qtfs_conn_param_init(); g_qtfs_epoll_thread = kthread_run(qtfs_epoll_thread, NULL, "qtfs_epoll"); if (IS_ERR_OR_NULL(g_qtfs_epoll_thread)) { @@ -288,7 +289,7 @@ static void __exit qtfs_exit(void) kfree(qtfs_epoll_var); qtfs_epoll_var = NULL; } - qtfs_whitelist_initset(); + qtfs_whitelist_exit(); kfree(qtfs_diag_info); qtfs_diag_info = NULL; diff --git a/qtfs/qtfs/qtfs-mod.h b/qtfs/qtfs/qtfs-mod.h index bf38babbb6eebae5856e0deb6e8d5714bd413fe3..3939e0facdada958be458db3e456d180a853fd58 100644 --- a/qtfs/qtfs/qtfs-mod.h +++ b/qtfs/qtfs/qtfs-mod.h @@ -184,6 +184,7 @@ struct dentry *qtfs_fs_mount(struct file_system_type *fs_type, void *qtfs_remote_run(struct qtfs_conn_var_s *pvar, unsigned int type, unsigned int len); int qtfs_misc_register(void); void qtfs_misc_destroy(void); +void qtfs_whitelist_exit(void); long qtfs_misc_ioctl(struct file *file, unsigned int cmd, unsigned long arg); int qtfs_missmsg_proc(struct qtfs_conn_var_s *pvar); int qtfs_utils_register(void); diff --git a/qtfs/qtfs_common/misc.c b/qtfs/qtfs_common/misc.c index beff5cb06e0d4eb58a0077316c909f59e7b99124..6f84b9506c4ceb48fa921c636aaf54e9a9ef27e9 100644 --- a/qtfs/qtfs_common/misc.c +++ b/qtfs/qtfs_common/misc.c @@ -257,6 +257,12 @@ void qtfs_whitelist_clearall(void) return; } +void qtfs_whitelist_exit(void) +{ + qtfs_whitelist_clearall(); + return; +} + long qtfs_misc_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { long ret = QTOK; diff --git a/qtfs/qtfs_server/qtfs-server.c b/qtfs/qtfs_server/qtfs-server.c index e6915747fbd796fb4911dcdeb8ff967367e47e3c..12d2ed0952b478e4eeea81f03640e8b44a1de053 100644 --- a/qtfs/qtfs_server/qtfs-server.c +++ b/qtfs/qtfs_server/qtfs-server.c @@ -46,6 +46,19 @@ struct qtfs_server_epoll_s qtfs_epoll = { }; rwlock_t qtfs_epoll_rwlock; +void qtfs_server_epoll_exit(void) +{ + write_lock(&qtfs_epoll_rwlock); + if (qtfs_epoll.kevents == NULL) { + write_unlock(&qtfs_epoll_rwlock); + return; + } + kfree(qtfs_epoll.kevents); + qtfs_epoll.kevents = NULL; + write_unlock(&qtfs_epoll_rwlock); + return; +} + long qtfs_server_epoll_thread(struct qtfs_conn_var_s *pvar) { int n; @@ -412,6 +425,8 @@ static void __exit qtfs_server_exit(void) qtfs_fd_bitmap.nbits = 0; } write_unlock(&g_userp_rwlock); + qtfs_whitelist_exit(); + qtfs_server_epoll_exit(); qtfs_misc_destroy(); qtfs_syscall_replace_stop(); diff --git a/qtfs/qtfs_server/qtfs-server.h b/qtfs/qtfs_server/qtfs-server.h index bfab00a96bfd5f47b6c3638780d329721ea34643..8135dbbf53b2712819a7ec881ef2606f5c65ee60 100644 --- a/qtfs/qtfs_server/qtfs-server.h +++ b/qtfs/qtfs_server/qtfs-server.h @@ -43,6 +43,7 @@ int qtfs_conn_server_run(struct qtfs_conn_var_s *pvar); long qtfs_misc_ioctl(struct file *file, unsigned int cmd, unsigned long arg); int qtfs_misc_register(void); void qtfs_misc_destroy(void); +void qtfs_whitelist_exit(void); long qtfs_misc_ioctl(struct file *file, unsigned int cmd, unsigned long arg); void qtfs_whitelist_clearall(void); void qtfs_whitelist_initset(void);