From patchwork Thu Aug 23 12:37:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artem Bityutskiy X-Patchwork-Id: 1366901 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 60303DF2AB for ; Thu, 23 Aug 2012 12:36:22 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T4Wan-0001v1-I5; Thu, 23 Aug 2012 12:32:57 +0000 Received: from mga09.intel.com ([134.134.136.24]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T4Waj-0001ub-VQ; Thu, 23 Aug 2012 12:32:54 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 23 Aug 2012 05:32:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,300,1344236400"; d="asc'?scan'208";a="190403572" Received: from linux.jf.intel.com (HELO linux.intel.com) ([10.23.219.25]) by orsmga002.jf.intel.com with ESMTP; 23 Aug 2012 05:32:51 -0700 Received: from [10.237.72.96] (sauron.fi.intel.com [10.237.72.96]) by linux.intel.com (Postfix) with ESMTP id AC5652C8001; Thu, 23 Aug 2012 05:32:50 -0700 (PDT) Message-ID: <1345725459.2848.238.camel@sauron.fi.intel.com> Subject: Re: JFFS2 issue with v3.5.x and later on Atmel chips at least From: Artem Bityutskiy To: "ludovic.desroches" Date: Thu, 23 Aug 2012 15:37:39 +0300 In-Reply-To: <5035F266.2040909@atmel.com> References: <5034B45A.5060107@atmel.com> <5034F3F8.9080802@atmel.com> <1345707689.2848.203.camel@sauron.fi.intel.com> <5035F266.2040909@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: linux-mtd@lists.infradead.org, Jean-Christophe PLAGNIOL-VILLARD , Nicolas Ferre , Linux Kernel list , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: artem.bityutskiy@linux.intel.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On Thu, 2012-08-23 at 11:05 +0200, ludovic.desroches wrote: > > Tested-by: Ludovic Desroches Thanks, pushed to l2-mtd.git tree a bit modified patch. Will ping dwmw2 about merging it to Linus. 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 --- fs/jffs2/super.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c index 61ea413..1224d6b 100644 --- a/fs/jffs2/super.c +++ b/fs/jffs2/super.c @@ -100,6 +100,10 @@ static int jffs2_sync_fs(struct super_block *sb, int wait) { struct jffs2_sb_info *c = JFFS2_SB_INFO(sb); +#ifdef CONFIG_JFFS2_FS_WRITEBUFFER + cancel_delayed_work_sync(&c->wbuf_dwork); +#endif + mutex_lock(&c->alloc_sem); jffs2_flush_wbuf_pad(c); mutex_unlock(&c->alloc_sem);