public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: tinguely@sgi.com
To: xfs@oss.sgi.com
Subject: [RFC] xfs: wait for the write of the superblock on unmount
Date: Tue, 18 Jul 2012 12:33:58 -0500	[thread overview]
Message-ID: <20120718220003.396849822@tinguelysgi.com> (raw)
In-Reply-To: 20120717215957.855744999@tinguelysgi.com

[-- Attachment #1: xfs-lock_sbcount_wait.patch --]
[-- Type: text/plain, Size: 1466 bytes --]

Sorry, I have been distracted away from this regression. This was previously
titled "xfs: synchronously write the superblock on unmount".

xfs_wait_buftarg() does not wait for the completion of the write of the
uncached superblock. This write can race with the shutdown of the log and
causes a panic if the write does not win the race.

The log write of the superblock is important for possible recovery, but a
second syncronous write of the same superblock seems redundant. Would just
waiting for the iodone() of the log write before tearing down the log be
enough?

Signed-off-by: Mark Tinguely <tinguely@sgi.com>

---
 fs/xfs/xfs_mount.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Index: b/fs/xfs/xfs_mount.c
===================================================================
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -1457,6 +1457,7 @@ void
 xfs_unmountfs(
 	struct xfs_mount	*mp)
 {
+	struct xfs_buf		*bp = mp->m_sb_bp;
 	__uint64_t		resblks;
 	int			error;
 
@@ -1529,6 +1530,13 @@ xfs_unmountfs(
 	xfs_ail_push_all_sync(mp->m_ail);
 	xfs_wait_buftarg(mp->m_ddev_targp);
 
+	/*
+	 * Wait for the superblock to be written out. The superblock buffer
+	 * will remain locked until the iodone().
+	 */
+	xfs_buf_lock(bp);
+	xfs_buf_unlock(bp);
+
 	xfs_log_unmount_write(mp);
 	xfs_log_unmount(mp);
 	xfs_uuid_unmount(mp);


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

       reply	other threads:[~2012-07-18 17:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20120717215957.855744999@tinguelysgi.com>
2012-07-18 17:33 ` tinguely [this message]
2012-07-19  1:58   ` [RFC] xfs: wait for the write of the superblock on unmount Dave Chinner
2012-07-20 13:21     ` Mark Tinguely
2012-07-20 21:24       ` Mark Tinguely
2012-07-24 13:57   ` Christoph Hellwig
2012-07-24 14:03     ` Mark Tinguely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120718220003.396849822@tinguelysgi.com \
    --to=tinguely@sgi.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox