Jan Kara
2009-Feb-26 20:14 UTC
[Ocfs2-devel] [PATCH 0/7] OCFS2 locking fixes and lockdep annotations
Hi, the first four patches in this series fix locking problems in OCFS2 quota code (three of them can lead to potential deadlocks). The fifth patch reorders ip_alloc_sem for directories to be acquired before localalloc locks. Mark would you please merge these? The last two patches implement lockdep annotations for OCFS2 cluster locks. We annotate all the cluster locks except for special ones like open lock or local quota file lock - these are not held by any particular process and thus lockdep cannot properly track them. I can still hit some lockdep warnings with it (I'll report them separately) but I think the patch is already in a decent state and I don't expect major changes. Please consider merging these lockdep patches. Happy testing. As always, comments are welcome. Honza
Jan Kara
2009-Feb-26 20:14 UTC
[Ocfs2-devel] [PATCH 1/7] ocfs2: Fix possible deadlock in ocfs2_global_read_dquot()
It is not possible to get a read lock and then try to get the same write lock in one thread as that can block on downconvert being requested by other node leading to deadlock. So first drop the quota lock for reading and only after that get it for writing. Signed-off-by: Jan Kara <jack at suse.cz> --- fs/ocfs2/quota_global.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c index 1ed0f7c..edfa60c 100644 --- a/fs/ocfs2/quota_global.c +++ b/fs/ocfs2/quota_global.c @@ -421,6 +421,7 @@ int ocfs2_global_read_dquot(struct dquot *dquot) OCFS2_DQUOT(dquot)->dq_originodes = dquot->dq_dqb.dqb_curinodes; if (!dquot->dq_off) { /* No real quota entry? */ /* Upgrade to exclusive lock for allocation */ + ocfs2_qinfo_unlock(info, 0); err = ocfs2_qinfo_lock(info, 1); if (err < 0) goto out_qlock; @@ -435,7 +436,8 @@ int ocfs2_global_read_dquot(struct dquot *dquot) out_qlock: if (ex) ocfs2_qinfo_unlock(info, 1); - ocfs2_qinfo_unlock(info, 0); + else + ocfs2_qinfo_unlock(info, 0); out: if (err < 0) mlog_errno(err); -- 1.6.0.2
Maybe Matching Threads
- [PATCH 0/7] [RESEND] Fix some deadlocks in quota code and implement lockdep for cluster locks
- [PATCH 0/2] OCFS2 lockdep support
- [git patches] Ocfs2 patches for merge window, batch 2/3
- [PATCH 1/1] OCFS2: fix for nfs getting stale inode.
- Patches that adds delayed orphan scan timer (rev 3)