Преглед изворни кода

ieee1394: fix another deadlock in nodemgr

A "modprobe ohci1394; sleep 1.5; modprobe -r ohci1394" could get stuck
in uninterruptible state, especially if an external node was connected.
http://bugzilla.kernel.org/show_bug.cgi?id=7792

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Stefan Richter пре 18 година
родитељ
комит
a65421ea3f
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      drivers/ieee1394/nodemgr.c

+ 2 - 1
drivers/ieee1394/nodemgr.c

@@ -1681,7 +1681,8 @@ static int nodemgr_host_thread(void *__hi)
 	for (;;) {
 	for (;;) {
 		/* Sleep until next bus reset */
 		/* Sleep until next bus reset */
 		set_current_state(TASK_INTERRUPTIBLE);
 		set_current_state(TASK_INTERRUPTIBLE);
-		if (get_hpsb_generation(host) == generation)
+		if (get_hpsb_generation(host) == generation &&
+		    !kthread_should_stop())
 			schedule();
 			schedule();
 		__set_current_state(TASK_RUNNING);
 		__set_current_state(TASK_RUNNING);