diff options
author | jiangyiwen <jiangyiwen@huawei.com> | 2014-06-23 16:22:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-23 19:47:45 -0400 |
commit | b9aaac5a6b7d228435fcb80963d41c274406011b (patch) | |
tree | 65c6e7a065d171d691b32391b5ccd81fe4b948bd /fs | |
parent | 595297a8f9bc27f8f4a537fd57ed6d0a2060fb46 (diff) |
ocfs2: do not return DLM_MIGRATE_RESPONSE_MASTERY_REF to avoid endless,loop during umount
The following case may lead to endless loop during umount.
node A node B node C node D
umount volume,
migrate lockres1
to B
want to lock lockres1,
send
MASTER_REQUEST_MSG
to C
init block mle
send
MIGRATE_REQUEST_MSG
to C
find a block
mle, and then
return
DLM_MIGRATE_RESPONSE_MASTERY_REF
to B
set C in refmap
umount successfully
try to umount, endless
loop occurs when migrate
lockres1 since C is in
refmap
So we can fix this endless loop case by only returning
DLM_MIGRATE_RESPONSE_MASTERY_REF if it has a mastery mle when receiving
MIGRATE_REQUEST_MSG.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: jiangyiwen <jiangyiwen@huawei.com>
Reviewed-by: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Xue jiufei <xuejiufei@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/dlm/dlmmaster.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index 3087a21d32f9..4f4b00e173f2 100644 --- a/fs/ocfs2/dlm/dlmmaster.c +++ b/fs/ocfs2/dlm/dlmmaster.c | |||
@@ -3088,11 +3088,15 @@ static int dlm_add_migration_mle(struct dlm_ctxt *dlm, | |||
3088 | /* remove it so that only one mle will be found */ | 3088 | /* remove it so that only one mle will be found */ |
3089 | __dlm_unlink_mle(dlm, tmp); | 3089 | __dlm_unlink_mle(dlm, tmp); |
3090 | __dlm_mle_detach_hb_events(dlm, tmp); | 3090 | __dlm_mle_detach_hb_events(dlm, tmp); |
3091 | ret = DLM_MIGRATE_RESPONSE_MASTERY_REF; | 3091 | if (tmp->type == DLM_MLE_MASTER) { |
3092 | mlog(0, "%s:%.*s: master=%u, newmaster=%u, " | 3092 | ret = DLM_MIGRATE_RESPONSE_MASTERY_REF; |
3093 | "telling master to get ref for cleared out mle " | 3093 | mlog(0, "%s:%.*s: master=%u, newmaster=%u, " |
3094 | "during migration\n", dlm->name, namelen, name, | 3094 | "telling master to get ref " |
3095 | master, new_master); | 3095 | "for cleared out mle during " |
3096 | "migration\n", dlm->name, | ||
3097 | namelen, name, master, | ||
3098 | new_master); | ||
3099 | } | ||
3096 | } | 3100 | } |
3097 | spin_unlock(&tmp->spinlock); | 3101 | spin_unlock(&tmp->spinlock); |
3098 | } | 3102 | } |