diff options
-rw-r--r-- | fs/ocfs2/dlm/dlmconvert.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ocfs2/dlm/dlmconvert.c b/fs/ocfs2/dlm/dlmconvert.c index 6001b22a997d..f5c2f1979ad3 100644 --- a/fs/ocfs2/dlm/dlmconvert.c +++ b/fs/ocfs2/dlm/dlmconvert.c | |||
@@ -421,7 +421,7 @@ int dlm_convert_lock_handler(struct o2net_msg *msg, u32 len, void *data) | |||
421 | struct dlm_lockstatus *lksb; | 421 | struct dlm_lockstatus *lksb; |
422 | enum dlm_status status = DLM_NORMAL; | 422 | enum dlm_status status = DLM_NORMAL; |
423 | u32 flags; | 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 | if (!dlm_grab(dlm)) { | 426 | if (!dlm_grab(dlm)) { |
427 | dlm_error(DLM_REJECTED); | 427 | dlm_error(DLM_REJECTED); |
@@ -490,6 +490,7 @@ int dlm_convert_lock_handler(struct o2net_msg *msg, u32 len, void *data) | |||
490 | status = __dlm_lockres_state_to_status(res); | 490 | status = __dlm_lockres_state_to_status(res); |
491 | if (status == DLM_NORMAL) { | 491 | if (status == DLM_NORMAL) { |
492 | __dlm_lockres_reserve_ast(res); | 492 | __dlm_lockres_reserve_ast(res); |
493 | ast_reserved = 1; | ||
493 | res->state |= DLM_LOCK_RES_IN_PROGRESS; | 494 | res->state |= DLM_LOCK_RES_IN_PROGRESS; |
494 | status = __dlmconvert_master(dlm, res, lock, flags, | 495 | status = __dlmconvert_master(dlm, res, lock, flags, |
495 | cnv->requested_type, | 496 | cnv->requested_type, |
@@ -512,10 +513,10 @@ leave: | |||
512 | else | 513 | else |
513 | dlm_lock_put(lock); | 514 | dlm_lock_put(lock); |
514 | 515 | ||
515 | /* either queue the ast or release it */ | 516 | /* either queue the ast or release it, if reserved */ |
516 | if (call_ast) | 517 | if (call_ast) |
517 | dlm_queue_ast(dlm, lock); | 518 | dlm_queue_ast(dlm, lock); |
518 | else | 519 | else if (ast_reserved) |
519 | dlm_lockres_release_ast(dlm, res); | 520 | dlm_lockres_release_ast(dlm, res); |
520 | 521 | ||
521 | if (kick_thread) | 522 | if (kick_thread) |