From patchwork Wed Nov 5 15:27:18 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaliy Gusev X-Patchwork-Id: 7352 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E1A80DDDF3 for ; Thu, 6 Nov 2008 02:58:55 +1100 (EST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux)) id 1Kxkke-0006wb-7s; Wed, 05 Nov 2008 15:57:00 +0000 Received: from mailhub.sw.ru ([195.214.232.25] helo=relay.sw.ru) by bombadil.infradead.org with esmtps (Exim 4.68 #1 (Red Hat Linux)) id 1Kxkkb-0006ew-5f; Wed, 05 Nov 2008 15:56:58 +0000 Received: from dhcp-10-30-19-28.sw.ru ([10.30.19.28]) (authenticated bits=0) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id mA5FGaME007395 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 5 Nov 2008 18:16:38 +0300 (MSK) From: Vitaliy Gusev To: David Woodhouse Subject: [PATCH] UBI: Don't exit from ubi_thread until kthread_should_stop() is true Date: Wed, 5 Nov 2008 18:27:18 +0300 User-Agent: KMail/1.9.6 (enterprise 20070904.708012) MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200811051827.19164.vgusev@openvz.org> X-Spam-Score: 0.0 (/) Cc: Artem Bityutskiy , linux-mtd@lists.infradead.org X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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 diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index 05d7093..dcb6dac 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c @@ -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;