From: Eric Sandeen Date: Thu, 3 Feb 2011 19:33:15 +0000 (-0500) Subject: ext4: fix panic on module unload when stopping lazyinit thread X-Git-Tag: v2.6.37.1~141 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=974bc5d1969424f1a659a8dbe94e4378bf7d2261;p=pandora-kernel.git ext4: fix panic on module unload when stopping lazyinit thread commit 8f1f745331c1b560f53c0d60e55a4f4f43f7cce5 upstream. https://bugzilla.kernel.org/show_bug.cgi?id=27652 If the lazyinit thread is running, the teardown function ext4_destroy_lazyinit_thread() has problems: ext4_clear_request_list(); while (ext4_li_info->li_task) { wake_up(&ext4_li_info->li_wait_daemon); wait_event(ext4_li_info->li_wait_task, ext4_li_info->li_task == NULL); } Clearing the request list will cause the thread to exit and free ext4_li_info, so then we're waiting on something which is getting freed. Fix this up by making the thread respond to kthread_stop, and exit, without the need to wait for that exit in some other homegrown way. Reported-and-Tested-by: Tao Ma Signed-off-by: Eric Sandeen Signed-off-by: "Theodore Ts'o" Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed