From patchwork Mon Feb 4 21:47:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herton Ronaldo Krzesinski X-Patchwork-Id: 218094 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 1E06E2C02E8 for ; Tue, 5 Feb 2013 08:47:27 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1U2Tsl-00082f-LZ; Mon, 04 Feb 2013 21:47:19 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1U2Tsh-00080C-33 for kernel-team@lists.ubuntu.com; Mon, 04 Feb 2013 21:47:15 +0000 Received: from [186.212.215.32] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1U2Tsf-0006cN-Q9; Mon, 04 Feb 2013 21:47:14 +0000 From: Herton Ronaldo Krzesinski To: Dave Chinner Subject: [ 3.5.y.z extended stable ] Patch "xfs: fix periodic log flushing" has been added to staging queue Date: Mon, 4 Feb 2013 19:47:10 -0200 Message-Id: <1360014430-4311-1-git-send-email-herton.krzesinski@canonical.com> X-Mailer: git-send-email 1.7.9.5 X-Extended-Stable: 3.5 Cc: Ben Myers , kernel-team@lists.ubuntu.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com This is a note to let you know that I have just added a patch titled xfs: fix periodic log flushing to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree which can be found at: http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue If you, or anyone else, feels it should not be added to this tree, please reply to this email. For more information about the 3.5.y.z tree, see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable Thanks. -Herton ------ From ae0f07824ba78fef7361f579493b7a9445745150 Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Fri, 25 Jan 2013 12:45:07 -0600 Subject: [PATCH] xfs: fix periodic log flushing [ Please take this patch for -stable in kernels 3.5-3.7. It doesn't have an equivalent upstream commit because the code was removed before the bug was discovered. See f661f1e0bf50 and 7e18530bef6a ] There is a logic inversion in xfssyncd_worker() which means that the log is not periodically forced or idled correctly. This means that metadata changes aggregated in memory do not get flushed in a timely manner, and hence if filesystem is not cleanly unmounted those changes can be lost. This loss can manifest itself even hours after the changes were made if the filesystem is left to idle without a sync() occurring between the last modification and the crash/shutdown occuring. Signed-off-by: Dave Chinner Reviewed-by: Ben Myers Signed-off-by: Ben Myers [ herton: adjust context ] Signed-off-by: Herton Ronaldo Krzesinski --- fs/xfs/xfs_sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.7.9.5 diff --git a/fs/xfs/xfs_sync.c b/fs/xfs/xfs_sync.c index 1e9ee06..f3b3b3e 100644 --- a/fs/xfs/xfs_sync.c +++ b/fs/xfs/xfs_sync.c @@ -391,7 +391,7 @@ xfs_sync_worker( * cancel_delayed_work_sync on this work queue before tearing down * the ail and the log in xfs_log_unmount. */ - if (!(mp->m_super->s_flags & MS_ACTIVE) && + if ((mp->m_super->s_flags & MS_ACTIVE) && !(mp->m_flags & XFS_MOUNT_RDONLY)) { /* dgc: errors ignored here */ if (mp->m_super->s_frozen == SB_UNFROZEN &&