diff options
Diffstat (limited to 'fs/ocfs2/dlm/dlmthread.c')
-rw-r--r-- | fs/ocfs2/dlm/dlmthread.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/ocfs2/dlm/dlmthread.c b/fs/ocfs2/dlm/dlmthread.c index 11a6d1fd1d35..d4f73ca68fe5 100644 --- a/fs/ocfs2/dlm/dlmthread.c +++ b/fs/ocfs2/dlm/dlmthread.c | |||
@@ -309,6 +309,7 @@ static void dlm_shuffle_lists(struct dlm_ctxt *dlm, | |||
309 | * spinlock, and because we know that it is not migrating/ | 309 | * spinlock, and because we know that it is not migrating/ |
310 | * recovering/in-progress, it is fine to reserve asts and | 310 | * recovering/in-progress, it is fine to reserve asts and |
311 | * basts right before queueing them all throughout */ | 311 | * basts right before queueing them all throughout */ |
312 | assert_spin_locked(&dlm->ast_lock); | ||
312 | assert_spin_locked(&res->spinlock); | 313 | assert_spin_locked(&res->spinlock); |
313 | BUG_ON((res->state & (DLM_LOCK_RES_MIGRATING| | 314 | BUG_ON((res->state & (DLM_LOCK_RES_MIGRATING| |
314 | DLM_LOCK_RES_RECOVERING| | 315 | DLM_LOCK_RES_RECOVERING| |
@@ -337,7 +338,7 @@ converting: | |||
337 | /* queue the BAST if not already */ | 338 | /* queue the BAST if not already */ |
338 | if (lock->ml.highest_blocked == LKM_IVMODE) { | 339 | if (lock->ml.highest_blocked == LKM_IVMODE) { |
339 | __dlm_lockres_reserve_ast(res); | 340 | __dlm_lockres_reserve_ast(res); |
340 | dlm_queue_bast(dlm, lock); | 341 | __dlm_queue_bast(dlm, lock); |
341 | } | 342 | } |
342 | /* update the highest_blocked if needed */ | 343 | /* update the highest_blocked if needed */ |
343 | if (lock->ml.highest_blocked < target->ml.convert_type) | 344 | if (lock->ml.highest_blocked < target->ml.convert_type) |
@@ -355,7 +356,7 @@ converting: | |||
355 | can_grant = 0; | 356 | can_grant = 0; |
356 | if (lock->ml.highest_blocked == LKM_IVMODE) { | 357 | if (lock->ml.highest_blocked == LKM_IVMODE) { |
357 | __dlm_lockres_reserve_ast(res); | 358 | __dlm_lockres_reserve_ast(res); |
358 | dlm_queue_bast(dlm, lock); | 359 | __dlm_queue_bast(dlm, lock); |
359 | } | 360 | } |
360 | if (lock->ml.highest_blocked < target->ml.convert_type) | 361 | if (lock->ml.highest_blocked < target->ml.convert_type) |
361 | lock->ml.highest_blocked = | 362 | lock->ml.highest_blocked = |
@@ -383,7 +384,7 @@ converting: | |||
383 | spin_unlock(&target->spinlock); | 384 | spin_unlock(&target->spinlock); |
384 | 385 | ||
385 | __dlm_lockres_reserve_ast(res); | 386 | __dlm_lockres_reserve_ast(res); |
386 | dlm_queue_ast(dlm, target); | 387 | __dlm_queue_ast(dlm, target); |
387 | /* go back and check for more */ | 388 | /* go back and check for more */ |
388 | goto converting; | 389 | goto converting; |
389 | } | 390 | } |
@@ -402,7 +403,7 @@ blocked: | |||
402 | can_grant = 0; | 403 | can_grant = 0; |
403 | if (lock->ml.highest_blocked == LKM_IVMODE) { | 404 | if (lock->ml.highest_blocked == LKM_IVMODE) { |
404 | __dlm_lockres_reserve_ast(res); | 405 | __dlm_lockres_reserve_ast(res); |
405 | dlm_queue_bast(dlm, lock); | 406 | __dlm_queue_bast(dlm, lock); |
406 | } | 407 | } |
407 | if (lock->ml.highest_blocked < target->ml.type) | 408 | if (lock->ml.highest_blocked < target->ml.type) |
408 | lock->ml.highest_blocked = target->ml.type; | 409 | lock->ml.highest_blocked = target->ml.type; |
@@ -418,7 +419,7 @@ blocked: | |||
418 | can_grant = 0; | 419 | can_grant = 0; |
419 | if (lock->ml.highest_blocked == LKM_IVMODE) { | 420 | if (lock->ml.highest_blocked == LKM_IVMODE) { |
420 | __dlm_lockres_reserve_ast(res); | 421 | __dlm_lockres_reserve_ast(res); |
421 | dlm_queue_bast(dlm, lock); | 422 | __dlm_queue_bast(dlm, lock); |
422 | } | 423 | } |
423 | if (lock->ml.highest_blocked < target->ml.type) | 424 | if (lock->ml.highest_blocked < target->ml.type) |
424 | lock->ml.highest_blocked = target->ml.type; | 425 | lock->ml.highest_blocked = target->ml.type; |
@@ -444,7 +445,7 @@ blocked: | |||
444 | spin_unlock(&target->spinlock); | 445 | spin_unlock(&target->spinlock); |
445 | 446 | ||
446 | __dlm_lockres_reserve_ast(res); | 447 | __dlm_lockres_reserve_ast(res); |
447 | dlm_queue_ast(dlm, target); | 448 | __dlm_queue_ast(dlm, target); |
448 | /* go back and check for more */ | 449 | /* go back and check for more */ |
449 | goto converting; | 450 | goto converting; |
450 | } | 451 | } |
@@ -674,6 +675,7 @@ static int dlm_thread(void *data) | |||
674 | /* lockres can be re-dirtied/re-added to the | 675 | /* lockres can be re-dirtied/re-added to the |
675 | * dirty_list in this gap, but that is ok */ | 676 | * dirty_list in this gap, but that is ok */ |
676 | 677 | ||
678 | spin_lock(&dlm->ast_lock); | ||
677 | spin_lock(&res->spinlock); | 679 | spin_lock(&res->spinlock); |
678 | if (res->owner != dlm->node_num) { | 680 | if (res->owner != dlm->node_num) { |
679 | __dlm_print_one_lock_resource(res); | 681 | __dlm_print_one_lock_resource(res); |
@@ -694,6 +696,7 @@ static int dlm_thread(void *data) | |||
694 | /* move it to the tail and keep going */ | 696 | /* move it to the tail and keep going */ |
695 | res->state &= ~DLM_LOCK_RES_DIRTY; | 697 | res->state &= ~DLM_LOCK_RES_DIRTY; |
696 | spin_unlock(&res->spinlock); | 698 | spin_unlock(&res->spinlock); |
699 | spin_unlock(&dlm->ast_lock); | ||
697 | mlog(0, "delaying list shuffling for in-" | 700 | mlog(0, "delaying list shuffling for in-" |
698 | "progress lockres %.*s, state=%d\n", | 701 | "progress lockres %.*s, state=%d\n", |
699 | res->lockname.len, res->lockname.name, | 702 | res->lockname.len, res->lockname.name, |
@@ -715,6 +718,7 @@ static int dlm_thread(void *data) | |||
715 | dlm_shuffle_lists(dlm, res); | 718 | dlm_shuffle_lists(dlm, res); |
716 | res->state &= ~DLM_LOCK_RES_DIRTY; | 719 | res->state &= ~DLM_LOCK_RES_DIRTY; |
717 | spin_unlock(&res->spinlock); | 720 | spin_unlock(&res->spinlock); |
721 | spin_unlock(&dlm->ast_lock); | ||
718 | 722 | ||
719 | dlm_lockres_calc_usage(dlm, res); | 723 | dlm_lockres_calc_usage(dlm, res); |
720 | 724 | ||