public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] fix lock inversion in forced unmount
@ 2008-04-02  0:17 David Chinner
  2008-04-07 12:52 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: David Chinner @ 2008-04-02  0:17 UTC (permalink / raw)
  To: xfs-dev; +Cc: xfs-oss

Fix lock inversion in forced shutdown.

Recent changes to xlog_state_release_iclog() placed the grant_lock
inside the icloglock. forced unmount of the log does this the opposite
way around, but does not depend on the order for correct working.
Fix the inversion by changing the order locks are gained in
xfs_log_force_umount().

Signed-off-by: Dave Chinner <dgc@sgi.com>
---
 fs/xfs/xfs_log.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: 2.6.x-xfs-new/fs/xfs/xfs_log.c
===================================================================
--- 2.6.x-xfs-new.orig/fs/xfs/xfs_log.c	2008-04-01 21:00:13.000000000 +1000
+++ 2.6.x-xfs-new/fs/xfs/xfs_log.c	2008-04-02 08:35:20.282633878 +1000
@@ -3502,8 +3502,8 @@ xfs_log_force_umount(
 	 * before we mark the filesystem SHUTDOWN and wake
 	 * everybody up to tell the bad news.
 	 */
-	spin_lock(&log->l_grant_lock);
 	spin_lock(&log->l_icloglock);
+	spin_lock(&log->l_grant_lock);
 	mp->m_flags |= XFS_MOUNT_FS_SHUTDOWN;
 	XFS_BUF_DONE(mp->m_sb_bp);
 	/*

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-04-07 12:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-02  0:17 [Patch] fix lock inversion in forced unmount David Chinner
2008-04-07 12:52 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox