From: David Chinner Date: Thu, 10 Apr 2008 02:19:02 +0000 (+1000) Subject: [XFS] Fix lock inversion in forced shutdown. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6b1d1a732f886936fe515d911b1a01d9cc50e179;p=mv-sheeva.git [XFS] 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(). SGI-PV: 979661 SGI-Modid: xfs-linux-melb:xfs-kern:30773a Signed-off-by: David Chinner Signed-off-by: Christoph Hellwig Signed-off-by: Lachlan McIlroy --- diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 319b98eb410..4a6f7c5d145 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -3499,8 +3499,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); /*