ocfs2: Fix deadlock on umount

Previous thread: Remove deadlock potential in md_open by Linux Kernel Mailing List on Thursday, August 13, 2009 - 11:59 am. (1 message)

Next thread: ocfs2: Define credit counts for quota operations by Linux Kernel Mailing List on Thursday, August 13, 2009 - 11:59 am. (1 message)
From: Linux Kernel Mailing List
Date: Thursday, August 13, 2009 - 11:59 am

Gitweb:     http://git.kernel.org/linus/f7b1aa69be138ad9d7d3f31fa56f4c9407f56b6a
Commit:     f7b1aa69be138ad9d7d3f31fa56f4c9407f56b6a
Parent:     3c5e10683e684ef45614c9071847e48f633d9806
Author:     Jan Kara <jack@suse.cz>
AuthorDate: Mon Jul 20 12:12:36 2009 +0200
Committer:  Joel Becker <joel.becker@oracle.com>
CommitDate: Tue Jul 21 15:47:55 2009 -0700

    ocfs2: Fix deadlock on umount
    
    In commit ea455f8ab68338ba69f5d3362b342c115bea8e13, we moved the dentry lock
    put process into ocfs2_wq. This causes problems during umount because ocfs2_wq
    can drop references to inodes while they are being invalidated by
    invalidate_inodes() causing all sorts of nasty things (invalidate_inodes()
    ending in an infinite loop, "Busy inodes after umount" messages etc.).
    
    We fix the problem by stopping ocfs2_wq from doing any further releasing of
    inode references on the superblock being unmounted, wait until it finishes
    the current round of releasing and finally cleaning up all the references in
    dentry_lock_list from ocfs2_put_super().
    
    The issue was tracked down by Tao Ma <tao.ma@oracle.com>.
    
    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: Joel Becker <joel.becker@oracle.com>
---
 fs/ocfs2/dcache.c |   35 +++++++++++++++++++++++++++--------
 fs/ocfs2/dcache.h |    3 +++
 fs/ocfs2/ocfs2.h  |   22 ++++++++++++++++++----
 fs/ocfs2/super.c  |   25 ++++++++++++++++++++++---
 4 files changed, 70 insertions(+), 15 deletions(-)

diff --git a/fs/ocfs2/dcache.c b/fs/ocfs2/dcache.c
index b574431..2f28b7d 100644
--- a/fs/ocfs2/dcache.c
+++ b/fs/ocfs2/dcache.c
@@ -310,22 +310,19 @@ out_attach:
 	return ret;
 }
 
-static DEFINE_SPINLOCK(dentry_list_lock);
+DEFINE_SPINLOCK(dentry_list_lock);
 
 /* We limit the number of dentry locks to drop in one go. We have
  * this limit so that we don't starve other users of ocfs2_wq. */
 #define DL_INODE_DROP_COUNT 64
 
 /* Drop inode references from dentry locks */
-void ...
Previous thread: Remove deadlock potential in md_open by Linux Kernel Mailing List on Thursday, August 13, 2009 - 11:59 am. (1 message)

Next thread: ocfs2: Define credit counts for quota operations by Linux Kernel Mailing List on Thursday, August 13, 2009 - 11:59 am. (1 message)