Skip to contentSkip to conversation

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

PATCH In review Vitaliy Gusev 2 participants 2 messages Nov 5, 2008 – Nov 6, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

drivers/mtd/ubi/wl.c +2 -1
index 05d7093..dcb6dac 100644
@@ -1396,7 +1396,8 @@ int ubi_thread(void *u)
 				ubi_msg("%s: %d consecutive failures",
 					ubi->bgt_name, WL_MAX_FAILURES);
 				ubi_ro_mode(ubi);
-				break;
+				ubi->thread_enabled = 0;
+				continue;
 			}
 		} else
 			failures = 0;
#1 lore raw
Quoted 5 lines · Vitaliy Gusev

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.

Thanks, I'll push your patch.

Signature · 2 lines
Best regards,
Artem Bityutskiy (Битюцкий Артём)