Pārlūkot izejas kodu

UBI: Don't exit from ubi_thread until kthread_should_stop() is true

If ubi_thread() exits but kthread_should_stop() is not true
then kthread_stop() will never return and cleanup thread
will forever stay in "D" state.

Signed-off-by: Vitaliy Gusev <vgusev@openvz.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Vitaliy Gusev 16 gadi atpakaļ
vecāks
revīzija
2ad4988715
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2 1
      drivers/mtd/ubi/wl.c

+ 2 - 1
drivers/mtd/ubi/wl.c

@@ -1396,7 +1396,8 @@ int ubi_thread(void *u)
 				ubi_msg("%s: %d consecutive failures",
 				ubi_msg("%s: %d consecutive failures",
 					ubi->bgt_name, WL_MAX_FAILURES);
 					ubi->bgt_name, WL_MAX_FAILURES);
 				ubi_ro_mode(ubi);
 				ubi_ro_mode(ubi);
-				break;
+				ubi->thread_enabled = 0;
+				continue;
 			}
 			}
 		} else
 		} else
 			failures = 0;
 			failures = 0;