[PATCH] ocfs2: fix release of ast never reserved

* fix a bug in dlm_convert_lock_handler where dlm_lockres_release_ast was
being called even if no ast was ever reserved

Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>

authored by Kurt Hackel and committed by Mark Fasheh e2b5e450 898effac

+4 -3
+4 -3
fs/ocfs2/dlm/dlmconvert.c
··· 421 421 struct dlm_lockstatus *lksb; 422 422 enum dlm_status status = DLM_NORMAL; 423 423 u32 flags; 424 - int call_ast = 0, kick_thread = 0; 424 + int call_ast = 0, kick_thread = 0, ast_reserved = 0; 425 425 426 426 if (!dlm_grab(dlm)) { 427 427 dlm_error(DLM_REJECTED); ··· 490 490 status = __dlm_lockres_state_to_status(res); 491 491 if (status == DLM_NORMAL) { 492 492 __dlm_lockres_reserve_ast(res); 493 + ast_reserved = 1; 493 494 res->state |= DLM_LOCK_RES_IN_PROGRESS; 494 495 status = __dlmconvert_master(dlm, res, lock, flags, 495 496 cnv->requested_type, ··· 513 512 else 514 513 dlm_lock_put(lock); 515 514 516 - /* either queue the ast or release it */ 515 + /* either queue the ast or release it, if reserved */ 517 516 if (call_ast) 518 517 dlm_queue_ast(dlm, lock); 519 - else 518 + else if (ast_reserved) 520 519 dlm_lockres_release_ast(dlm, res); 521 520 522 521 if (kick_thread)