2001-10-15 19:16:54

by Chris Mason

[permalink] [raw]
Subject: [PATCH] (ac only) quota deadlocks on unmount


Hello everyone,

Alan, you're cc'd as an FYI, don't apply this until you get
verification from someone who knows the quota code ;-)

dqput_blocks can return 0 when dqput might decide to call
commit_dqout. This is bad because remove_inode_dquot_ref
is called with the inode_lock held, and commit_dquot can
trigger schedules or another attempt on the inode_lock.

This is working for me:

-chris

Index: 0.43/fs/dquot.c
--- 0.43/fs/dquot.c Mon, 15 Oct 2001 03:51:05 -0400
+++ 0.43(w)/fs/dquot.c Mon, 15 Oct 2001 14:12:57 -0400
@@ -1246,6 +1246,8 @@
{
if (dquot->dq_dup_ref && dquot->dq_count - dquot->dq_dup_ref <= 1)
return 1;
+ if (dquot->dq_count <= 1 && dquot->dq_flags & DQ_MOD)
+ return 1;
return 0;
}