[Top] [All Lists]

[PATCH, -stable RFC] xfs: fix periodic log flushing

To: xfs@xxxxxxxxxxx
Subject: [PATCH, -stable RFC] xfs: fix periodic log flushing
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 19 Dec 2012 09:16:16 +1100
User-agent: Mutt/1.5.21 (2010-09-15)
From: Dave Chinner <dchinner@xxxxxxxxxx>

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.

cc: <stable@xxxxxxxxxxxxxx> # 3.7, 3.6, 3.5
Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
 fs/xfs/xfs_sync.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

If people agree the fix is correct, I'll post it to the -stable
list for inclusion...

diff --git a/fs/xfs/xfs_sync.c b/fs/xfs/xfs_sync.c
index 9500caf..7bf85e8 100644
--- a/fs/xfs/xfs_sync.c
+++ b/fs/xfs/xfs_sync.c
@@ -400,7 +400,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_writers.frozen == SB_UNFROZEN &&

<Prev in Thread] Current Thread [Next in Thread>