ocfs2: Fix possible deadlock in quota recovery
authorJan Kara <jack@suse.cz>
Tue, 2 Jun 2009 12:24:02 +0000 (14:24 +0200)
committerJoel Becker <joel.becker@oracle.com>
Thu, 4 Jun 2009 02:14:30 +0000 (19:14 -0700)
commit80d73f15d12f087f3fe074f8a4d6e5c5624f2b47
treee0f290b644535b785431ff16a93f6b3eb76d5359
parent65bac575e35915801ea518b9d8d8824367d125c8
ocfs2: Fix possible deadlock in quota recovery

In ocfs2_finish_quota_recovery() we acquired global quota file lock and started
recovering local quota file. During this process we need to get quota
structures, which calls ocfs2_dquot_acquire() which gets global quota file lock
again. This second lock can block in case some other node has requested the
quota file lock in the mean time. Fix the problem by moving quota file locking
down into the function where it is really needed.  Then dqget() or dqput()
won't be called with the lock held.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
fs/ocfs2/quota_local.c