ocfs2/dlm: Migrate lockres with no locks if it has a reference
authorSunil Mushran <sunil.mushran@oracle.com>
Fri, 19 Nov 2010 23:06:50 +0000 (15:06 -0800)
committerJoel Becker <joel.becker@oracle.com>
Thu, 9 Dec 2010 23:36:00 +0000 (15:36 -0800)
commit388c4bcb4e63e88fb1f312a2f5f9eb2623afcf5b
treea8688b4db823bddba613dff2c613260b2e92f23a
parent771f8bc71c31c6bd103cdec283012253f352ab1c
ocfs2/dlm: Migrate lockres with no locks if it has a reference

o2dlm was not migrating resources with zero locks because it assumed that that
resource would get purged by dlm_thread. However, some usage patterns involve
creating and dropping locks at a high rate leading to the migrate thread seeing
zero locks but the purge thread seeing an active reference. When this happens,
the dlm_thread cannot purge the resource and the migrate thread sees no reason
to migrate that resource. The spell is broken when the migrate thread catches
the resource with a lock.

The fix is to make the migrate thread also consider the reference map.

This usage pattern can be triggered by userspace on userdlm locks and flocks.

Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
fs/ocfs2/dlm/dlmmaster.c