Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c214b2cc5f9be7c236f9b91acf524688ff0e3e72
Commit:     c214b2cc5f9be7c236f9b91acf524688ff0e3e72
Parent:     1634c48f8b85dcb05101f1eb2eab9af40b5976da
Author:     Oleg Nesterov <[EMAIL PROTECTED]>
AuthorDate: Wed May 9 02:34:18 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed May 9 12:30:52 2007 -0700

    ipvs: flush defense_work before module unload
    
    net/ipv4/ipvs/ip_vs_core.c
    
        module_exit
            ip_vs_cleanup
                ip_vs_control_cleanup
                    cancel_rearming_delayed_work
        // done
    
    This is unsafe.  The module may be unloaded and the memory may be freed
    while defense_work's handler is still running/preempted.
    
    Do flush_work(&defense_work.work) after cancel_rearming_delayed_work().
    
    Alternatively, we could add flush_work() to cancel_rearming_delayed_work(),
    but note that we can't change cancel_delayed_work() in the same manner
    because it may be called from atomic context.
    
    Signed-off-by: Oleg Nesterov <[EMAIL PROTECTED]>
    Cc: "David S. Miller" <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 net/ipv4/ipvs/ip_vs_ctl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index b3050a6..342e836 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -2387,6 +2387,7 @@ void ip_vs_control_cleanup(void)
        EnterFunction(2);
        ip_vs_trash_cleanup();
        cancel_rearming_delayed_work(&defense_work);
+       flush_work_keventd(&defense_work.work);
        ip_vs_kill_estimator(&ip_vs_stats);
        unregister_sysctl_table(sysctl_header);
        proc_net_remove("ip_vs_stats");
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to