[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1329306980-17997-1-git-send-email-amit.sahrawat83@gmail.com>
Date: Wed, 15 Feb 2012 17:26:20 +0530
From: Amit Sahrawat <amit.sahrawat83@...il.com>
To: Ben Myers <bpm@....com>, Alex Elder <elder@...nel.org>,
Christoph Hellwig <hch@...radead.org>,
Dave Chinner <david@...morbit.com>, xfs-masters@....sgi.com,
xfs@....sgi.com
Cc: Nam-Jae Jeon <linkinjeon@...il.com>, linux-kernel@...r.kernel.org,
Amit Sahrawat <amit.sahrawat83@...il.com>
Subject: [PATCH 1/1] xfs: fix buffer flushing during log unmount
Whenever there is a mount/unmount failure - there is a chance of calling the
callbacks functions once - transaction ail mount pointer is destroyed. So, it results
in NULL pointer exception followed by hang. So, before unmount of the log - flush all
the pending buffers.
Signed-off-by: Amit Sahrawat <amit.sahrawat83@...il.com>
Signed-off-by: Namjae Jeon <linkinjeon@...il.com>
---
fs/xfs/xfs_log.c | 10 ++++++++++
fs/xfs/xfs_mount.c | 9 ---------
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index e2cc356..b924a5b 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -739,6 +739,16 @@ xfs_log_unmount_write(xfs_mount_t *mp)
void
xfs_log_unmount(xfs_mount_t *mp)
{
+ int error = 0;
+ /*
+ * Make sure all buffers have been flushed and completed before
+ * unmounting the log.
+ */
+ error = xfs_flush_buftarg(mp->m_ddev_targp, 1);
+ if (error)
+ cmn_err(CE_WARN, "%d busy buffers during log unmount.", error);
+ xfs_wait_buftarg(mp->m_ddev_targp);
+
xfs_trans_ail_destroy(mp);
xlog_dealloc_log(mp->m_log);
}
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index d06afbc..3bd2246 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -1519,15 +1519,6 @@ xfs_unmountfs(
"Freespace may not be correct on next mount.");
xfs_unmountfs_writesb(mp);
- /*
- * Make sure all buffers have been flushed and completed before
- * unmounting the log.
- */
- error = xfs_flush_buftarg(mp->m_ddev_targp, 1);
- if (error)
- xfs_warn(mp, "%d busy buffers during unmount.", error);
- xfs_wait_buftarg(mp->m_ddev_targp);
-
xfs_log_unmount_write(mp);
xfs_log_unmount(mp);
xfs_uuid_unmount(mp);
--
1.7.2.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists