From patchwork Thu Aug 23 07:41:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artem Bityutskiy X-Patchwork-Id: 179541 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 632212C009F for ; Thu, 23 Aug 2012 17:41:29 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T4S1C-0002ht-HL; Thu, 23 Aug 2012 07:39:54 +0000 Received: from mga09.intel.com ([134.134.136.24]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T4Ry8-0000rl-MV; Thu, 23 Aug 2012 07:36:46 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 23 Aug 2012 00:36:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,299,1344236400"; d="asc'?scan'208,223";a="184400689" Received: from linux.jf.intel.com (HELO linux.intel.com) ([10.23.219.25]) by orsmga001.jf.intel.com with ESMTP; 23 Aug 2012 00:36:41 -0700 Received: from [10.237.72.96] (sauron.fi.intel.com [10.237.72.96]) by linux.intel.com (Postfix) with ESMTP id 5B4FE2C8001; Thu, 23 Aug 2012 00:36:41 -0700 (PDT) Message-ID: <1345707689.2848.203.camel@sauron.fi.intel.com> Subject: Re: JFFS2 issue with v3.5.x and later on Atmel chips at least (was: Kernel oops since v3.5.x on Atmel chips) From: Artem Bityutskiy To: "ludovic.desroches" Date: Thu, 23 Aug 2012 10:41:29 +0300 In-Reply-To: <5034F3F8.9080802@atmel.com> References: <5034B45A.5060107@atmel.com> <5034F3F8.9080802@atmel.com> X-Mailer: Evolution 3.2.3 (3.2.3-3.fc16) Mime-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -7.1 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [134.134.136.24 listed in list.dnswl.org] -0.2 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Jean-Christophe PLAGNIOL-VILLARD , linux-mtd@lists.infradead.org, Linux Kernel list , "linux-arm-kernel@lists.infradead.org" , Nicolas Ferre X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: artem.bityutskiy@linux.intel.com 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 From: Artem Bityutskiy Date: Thu, 23 Aug 2012 10:10:07 +0300 Subject: [PATCH] JFFS2: fix unmount regression This patch fixes regression introduced by "8bdc81c jffs2: get rid of jffs2_sync_super". We submit a delayed work in order to make sure the write-buffer is synchronized at some point. But we do not flush it when we unmount, which causes an oops when we unmount the file-system and then the delayed work is executed. This patch fixes the issue by adding a "cancel_delayed_work_sync()" infocation in the '->sync_fs()' handler. This will make sure the delayed work is canceled on sync, unmount and re-mount. And because VFS always callse 'sync_fs()' before unmounting or remounting, this fixes the issue. Reported-by: Ludovic Desroches Cc: stable@vger.kernel.org [3.5+] Signed-off-by: Artem Bityutskiy Tested-by: Ludovic Desroches --- Ludovic, would you please give this patch a test? Also attached. fs/jffs2/super.c | 3 +++ 1 file changed, 3 insertions(+) From 2f1554d01f7db58631f9da7dd19a7254d1096feb Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Thu, 23 Aug 2012 10:10:07 +0300 Subject: [PATCH] JFFS2: fix unmount regression This patch fixes regression introduced by "8bdc81c jffs2: get rid of jffs2_sync_super". We submit a delayed work in order to make sure the write-buffer is synchronized at some point. But we do not flush it when we unmount, which causes an oops when we unmount the file-system and then the delayed work is executed. This patch fixes the issue by adding a "cancel_delayed_work_sync()" infocation in the '->sync_fs()' handler. This will make sure the delayed work is canceled on sync, unmount and re-mount. And because VFS always callse 'sync_fs()' before unmounting or remounting, this fixes the issue. Reported-by: Ludovic Desroches Cc: stable@vger.kernel.org [3.5+] Signed-off-by: Artem Bityutskiy --- fs/jffs2/super.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c index 61ea413..e385fa3 100644 --- a/fs/jffs2/super.c +++ b/fs/jffs2/super.c @@ -100,6 +100,9 @@ static int jffs2_sync_fs(struct super_block *sb, int wait) { struct jffs2_sb_info *c = JFFS2_SB_INFO(sb); + if (IS_ENABLED(CONFIG_JFFS2_FS_WRITEBUFFER)) + cancel_delayed_work_sync(&c->wbuf_dwork); + mutex_lock(&c->alloc_sem); jffs2_flush_wbuf_pad(c); mutex_unlock(&c->alloc_sem); -- 1.7.10.4