]> git.baikalelectronics.ru Git - kernel.git/commit
ocfs2: Fix possible deadlock when extending quota file
authorJan Kara <jack@suse.cz>
Thu, 6 Aug 2009 21:29:34 +0000 (23:29 +0200)
committerJoel Becker <joel.becker@oracle.com>
Mon, 10 Aug 2009 19:20:22 +0000 (12:20 -0700)
commitc5d3b6181f3ba8801785f6ff9db55c65ad455631
treef9f7861ff8b943ee905dc16a8290cac757df391e
parent1b1b56f3bd50064a4ac11e2db33a6dd26dbf1ae7
ocfs2: Fix possible deadlock when extending quota file

In OCFS2, allocator locks rank above transaction start. Thus we
cannot extend quota file from inside a transaction less we could
deadlock.

We solve the problem by starting transaction not already in
ocfs2_acquire_dquot() but only in ocfs2_local_read_dquot() and
ocfs2_global_read_dquot() and we allocate blocks to quota files before starting
the transaction.  In case we crash, quota files will just have a few blocks
more but that's no problem since we just use them next time we extend the
quota file.

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