diff options
Diffstat (limited to 'fs/ocfs2/dlm')
-rw-r--r-- | fs/ocfs2/dlm/dlmdomain.c | 3 | ||||
-rw-r--r-- | fs/ocfs2/dlm/dlmmaster.c | 22 | ||||
-rw-r--r-- | fs/ocfs2/dlm/dlmrecovery.c | 2 |
3 files changed, 17 insertions, 10 deletions
diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c index 6b5a492e1749..153abb5abef0 100644 --- a/fs/ocfs2/dlm/dlmdomain.c +++ b/fs/ocfs2/dlm/dlmdomain.c | |||
@@ -1671,7 +1671,7 @@ struct dlm_ctxt * dlm_register_domain(const char *domain, | |||
1671 | struct dlm_ctxt *dlm = NULL; | 1671 | struct dlm_ctxt *dlm = NULL; |
1672 | struct dlm_ctxt *new_ctxt = NULL; | 1672 | struct dlm_ctxt *new_ctxt = NULL; |
1673 | 1673 | ||
1674 | if (strlen(domain) > O2NM_MAX_NAME_LEN) { | 1674 | if (strlen(domain) >= O2NM_MAX_NAME_LEN) { |
1675 | ret = -ENAMETOOLONG; | 1675 | ret = -ENAMETOOLONG; |
1676 | mlog(ML_ERROR, "domain name length too long\n"); | 1676 | mlog(ML_ERROR, "domain name length too long\n"); |
1677 | goto leave; | 1677 | goto leave; |
@@ -1709,6 +1709,7 @@ retry: | |||
1709 | } | 1709 | } |
1710 | 1710 | ||
1711 | if (dlm_protocol_compare(&dlm->fs_locking_proto, fs_proto)) { | 1711 | if (dlm_protocol_compare(&dlm->fs_locking_proto, fs_proto)) { |
1712 | spin_unlock(&dlm_domain_lock); | ||
1712 | mlog(ML_ERROR, | 1713 | mlog(ML_ERROR, |
1713 | "Requested locking protocol version is not " | 1714 | "Requested locking protocol version is not " |
1714 | "compatible with already registered domain " | 1715 | "compatible with already registered domain " |
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index 4a7506a4e314..94b97fc6a88e 100644 --- a/fs/ocfs2/dlm/dlmmaster.c +++ b/fs/ocfs2/dlm/dlmmaster.c | |||
@@ -2808,14 +2808,8 @@ again: | |||
2808 | mlog(0, "trying again...\n"); | 2808 | mlog(0, "trying again...\n"); |
2809 | goto again; | 2809 | goto again; |
2810 | } | 2810 | } |
2811 | /* now that we are sure the MIGRATING state is there, drop | ||
2812 | * the unneded state which blocked threads trying to DIRTY */ | ||
2813 | spin_lock(&res->spinlock); | ||
2814 | BUG_ON(!(res->state & DLM_LOCK_RES_BLOCK_DIRTY)); | ||
2815 | BUG_ON(!(res->state & DLM_LOCK_RES_MIGRATING)); | ||
2816 | res->state &= ~DLM_LOCK_RES_BLOCK_DIRTY; | ||
2817 | spin_unlock(&res->spinlock); | ||
2818 | 2811 | ||
2812 | ret = 0; | ||
2819 | /* did the target go down or die? */ | 2813 | /* did the target go down or die? */ |
2820 | spin_lock(&dlm->spinlock); | 2814 | spin_lock(&dlm->spinlock); |
2821 | if (!test_bit(target, dlm->domain_map)) { | 2815 | if (!test_bit(target, dlm->domain_map)) { |
@@ -2826,9 +2820,21 @@ again: | |||
2826 | spin_unlock(&dlm->spinlock); | 2820 | spin_unlock(&dlm->spinlock); |
2827 | 2821 | ||
2828 | /* | 2822 | /* |
2823 | * if target is down, we need to clear DLM_LOCK_RES_BLOCK_DIRTY for | ||
2824 | * another try; otherwise, we are sure the MIGRATING state is there, | ||
2825 | * drop the unneded state which blocked threads trying to DIRTY | ||
2826 | */ | ||
2827 | spin_lock(&res->spinlock); | ||
2828 | BUG_ON(!(res->state & DLM_LOCK_RES_BLOCK_DIRTY)); | ||
2829 | res->state &= ~DLM_LOCK_RES_BLOCK_DIRTY; | ||
2830 | if (!ret) | ||
2831 | BUG_ON(!(res->state & DLM_LOCK_RES_MIGRATING)); | ||
2832 | spin_unlock(&res->spinlock); | ||
2833 | |||
2834 | /* | ||
2829 | * at this point: | 2835 | * at this point: |
2830 | * | 2836 | * |
2831 | * o the DLM_LOCK_RES_MIGRATING flag is set | 2837 | * o the DLM_LOCK_RES_MIGRATING flag is set if target not down |
2832 | * o there are no pending asts on this lockres | 2838 | * o there are no pending asts on this lockres |
2833 | * o all processes trying to reserve an ast on this | 2839 | * o all processes trying to reserve an ast on this |
2834 | * lockres must wait for the MIGRATING flag to clear | 2840 | * lockres must wait for the MIGRATING flag to clear |
diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c index f8b75ce4be70..9dfaac73b36d 100644 --- a/fs/ocfs2/dlm/dlmrecovery.c +++ b/fs/ocfs2/dlm/dlmrecovery.c | |||
@@ -463,7 +463,7 @@ static int dlm_do_recovery(struct dlm_ctxt *dlm) | |||
463 | if (dlm->reco.dead_node == O2NM_INVALID_NODE_NUM) { | 463 | if (dlm->reco.dead_node == O2NM_INVALID_NODE_NUM) { |
464 | int bit; | 464 | int bit; |
465 | 465 | ||
466 | bit = find_next_bit (dlm->recovery_map, O2NM_MAX_NODES+1, 0); | 466 | bit = find_next_bit (dlm->recovery_map, O2NM_MAX_NODES, 0); |
467 | if (bit >= O2NM_MAX_NODES || bit < 0) | 467 | if (bit >= O2NM_MAX_NODES || bit < 0) |
468 | dlm_set_reco_dead_node(dlm, O2NM_INVALID_NODE_NUM); | 468 | dlm_set_reco_dead_node(dlm, O2NM_INVALID_NODE_NUM); |
469 | else | 469 | else |