]> git.itanic.dy.fi Git - linux-stable/commit
ocfs2 fix o2dlm dlm run purgelist (rev 3)
authorSrinivas Eeda <srinivas.eeda@oracle.com>
Mon, 19 Jul 2010 23:04:12 +0000 (16:04 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 26 Aug 2010 23:41:36 +0000 (16:41 -0700)
commite293f896c883912f082613b0e3acaaacf489b2c9
treefab10565a8ef6d6c2c154742cc794e31d717f594
parent1bc668d6789ba22cf7d77a2cae59e53e5ef0ffc4
ocfs2 fix o2dlm dlm run purgelist (rev 3)

commit 7beaf243787f85a2ef9213ccf13ab4a243283fde upstream.

This patch fixes two problems in dlm_run_purgelist

1. If a lockres is found to be in use, dlm_run_purgelist keeps trying to purge
the same lockres instead of trying the next lockres.

2. When a lockres is found unused, dlm_run_purgelist releases lockres spinlock
before setting DLM_LOCK_RES_DROPPING_REF and calls dlm_purge_lockres.
spinlock is reacquired but in this window lockres can get reused. This leads
to BUG.

This patch modifies dlm_run_purgelist to skip lockres if it's in use and purge
 next lockres. It also sets DLM_LOCK_RES_DROPPING_REF before releasing the
lockres spinlock protecting it from getting reused.

Signed-off-by: Srinivas Eeda <srinivas.eeda@oracle.com>
Acked-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ocfs2/dlm/dlmthread.c