From patchwork Fri Aug 1 16:06:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Harris X-Patchwork-Id: 375799 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B7D481400FA for ; Sat, 2 Aug 2014 02:08:09 +1000 (EST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XDFMD-0002wB-Dm; Fri, 01 Aug 2014 16:07:01 +0000 Received: from mail-ig0-x22e.google.com ([2607:f8b0:4001:c05::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XDFMB-0002rW-UI for linux-mtd@lists.infradead.org; Fri, 01 Aug 2014 16:07:00 +0000 Received: by mail-ig0-f174.google.com with SMTP id c1so1825922igq.7 for ; Fri, 01 Aug 2014 09:06:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=2BOBnACMSi0mbfth9m8AvQAN0W2IpU5Z+1tEDdlvUbI=; b=jr6ofsafhof+E3V1xS36VVCBObfCVNgLBuKl6klQIGuq6pMp+KakjR4+gskHE4XD4e 95ubYClJNCl6bmVD3hf7QrP8aIn8LGBgvVD9wEhhfW0b6aH8DYB14LXUqGU18Uud13Na llkZZIJqBFJbtfmEjPs7ssCeIPuNoSHwgyQutFEniq5S72w0Ge7TqoMX9ZXhKTCB1BxD vUa3nXBdC3muAhvqXh5x9PuAtiaoGUkLlD9gk91X49ny/mvIXEcgLlpNYts5ocfq79nT 13WtYAWPmFvgi/i/seDE/LbyXSObYN6sO3w5aJN7RWaxvTUmUNCiXFrikWqr/+iyoEm4 hL9A== X-Received: by 10.42.49.196 with SMTP id x4mr8222805icf.85.1406909197778; Fri, 01 Aug 2014 09:06:37 -0700 (PDT) Received: from jeffh-linux.corp.kentrox.com (vpn.kentrox.com. [192.228.45.5]) by mx.google.com with ESMTPSA id w10sm11602214igr.18.2014.08.01.09.06.36 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Aug 2014 09:06:36 -0700 (PDT) From: Jeff Harris X-Google-Original-From: Jeff Harris To: David Woodhouse , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] jffs2: Re-enable write-buffering after filesystem sync Date: Fri, 1 Aug 2014 12:06:12 -0400 Message-Id: <1406909172-7219-1-git-send-email-jharris@westell.com> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140801_090700_027897_6E9E14ED X-CRM114-Status: GOOD ( 10.33 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (jefftharris[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid Cc: Jeff Harris X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org A JFFS2 filesystem sync cancels the write buffering dirty work and performs the flush manually. However, the flag which indicates that the work is active is not reset. Thus, if a sync happens while the work is pending, the flag will never be reset resulting in future work never being started. The flag is now reset under the appropriate lock along with the timer cancellation. Tested on 3.13.6. Signed-off-by: Jeff Harris --- fs/jffs2/super.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c index 0918f0e..263136b 100644 --- a/fs/jffs2/super.c +++ b/fs/jffs2/super.c @@ -101,7 +101,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 + spin_lock(&c->wbuf_dwork_lock); cancel_delayed_work_sync(&c->wbuf_dwork); + c->wbuf_queued = 0; + spin_lock(&c->wbuf_dwork_lock); #endif mutex_lock(&c->alloc_sem);