Date: Mon, 8 Apr 2024 06:49:13 GMT From: Vladimir Kondratyev <wulf@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 61fb195e8dd0 - main - LinuxKPI: Improve timer_shutdown_sync Message-ID: <202404080649.4386nDQm032844@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=61fb195e8dd08d4b006a176c09682f061424cb95 commit 61fb195e8dd08d4b006a176c09682f061424cb95 Author: Vladimir Kondratyev <wulf@FreeBSD.org> AuthorDate: 2024-04-08 06:47:42 +0000 Commit: Vladimir Kondratyev <wulf@FreeBSD.org> CommitDate: 2024-04-08 06:47:42 +0000 LinuxKPI: Improve timer_shutdown_sync timer_shutdown_sync not only shutdowns a timer but prevents it rearming. Sponsored by: Serenity CyberSecurity, LLC Reviewed by: emaste MFC after: 1 week --- sys/compat/linuxkpi/common/src/linux_compat.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index 36ed7b84cc94..a6eb7bb17e16 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -1920,6 +1920,10 @@ linux_timer_callback_wrapper(void *context) timer = context; + /* the timer is about to be shutdown permanently */ + if (timer->function == NULL) + return; + if (linux_set_current_flags(curthread, M_NOWAIT)) { /* try again later */ callout_reset(&timer->callout, 1, @@ -1992,6 +1996,7 @@ int timer_shutdown_sync(struct timer_list *timer) { + timer->function = NULL; return (del_timer_sync(timer)); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202404080649.4386nDQm032844>