xfs
[Top] [All Lists]

[PATCH for-2.6.33] xfs: flush all log buffers in xlog_dealloc_log

To: xfs@xxxxxxxxxxx
Subject: [PATCH for-2.6.33] xfs: flush all log buffers in xlog_dealloc_log
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 1 Feb 2010 17:08:13 -0500
User-agent: Mutt/1.5.19 (2009-01-05)
Make sure all log buffers have made it to disk before we free them.
Otherwise we might reference freed buffers or a NULL mp->m_log from
the I/O completion handlers.

This fixes kernel.org bz #15150.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>
Reported-by: Ed Cashin <ecashin@xxxxxxxxxx>
Reported-by: ghani <abdelghani@xxxxxxxxx>
Tested-by: ghani <abdelghani@xxxxxxxxx>

Index: linux-2.6/fs/xfs/xfs_log.c
===================================================================
--- linux-2.6.orig/fs/xfs/xfs_log.c     2009-11-09 22:09:08.858026060 +0100
+++ linux-2.6/fs/xfs/xfs_log.c  2009-11-09 22:13:13.958255857 +0100
@@ -1602,6 +1602,8 @@ xlog_dealloc_log(xlog_t *log)
        xlog_in_core_t  *iclog, *next_iclog;
        int             i;
 
+       xfs_flush_buftarg(log->l_mp->m_logdev_targp, 1);
+
        iclog = log->l_iclog;
        for (i=0; i<log->l_iclog_bufs; i++) {
                sv_destroy(&iclog->ic_force_wait);

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