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);
|