[Ocfs2-devel] [PATCH 03/18] ocfs2_dlm: Add missing dlm_lock_put()s

Joel Becker Joel.Becker at oracle.com
Thu Feb 28 14:38:34 PST 2008


On Mon, Feb 25, 2008 at 12:20:47PM -0800, Sunil Mushran wrote:
> Normally locks for remote nodes are freed when that node sends an UNLOCK
> message to the master. The master node tags an DLM_UNLOCK_FREE_LOCK action
> to do an extra put on the lock at the end.
> 
> However, there are times when the master node has to free the locks for the
> remote nodes forcibly.
> 
> Two cases when this happens are:
> 1. When the master has migrated the lockres plus all locks to another node.
> 2. When the master is clearing all the locks of a dead node.
> 
> It was in the above two conditions that the dlm was missing the extra put.
> 
> Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
> ---
>  fs/ocfs2/dlm/dlmmaster.c   |    2 ++
>  fs/ocfs2/dlm/dlmrecovery.c |    6 ++++++
>  2 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
> index 939b863..8e3c40e 100644
> --- a/fs/ocfs2/dlm/dlmmaster.c
> +++ b/fs/ocfs2/dlm/dlmmaster.c
> @@ -2973,6 +2973,8 @@ static void dlm_remove_nonlocal_locks(struct dlm_ctxt *dlm,
>  				dlm_lockres_clear_refmap_bit(lock->ml.node, res);
>  				list_del_init(&lock->list);
>  				dlm_lock_put(lock);
> +				/* DLM_UNLOCK_FREE_LOCK put */
> +				dlm_lock_put(lock);

	Good description in the patch, but it's opaque here.  Can we
have a comment like:

				/* Can't schedule DLM_UNLOCK_FREE_LOCK,
				 * do it here. */
 
Joel

-- 

"Depend on the rabbit's foot if you will, but remember, it didn't
 help the rabbit."
	- R. E. Shay

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-devel mailing list