* [Ocfs2-devel] [PATCH V2] ocfs2/dlm: clear migration_pending when migration target goes down
@ 2015-12-24 7:20 xuejiufei
2015-12-24 7:48 ` Joseph Qi
0 siblings, 1 reply; 2+ messages in thread
From: xuejiufei @ 2015-12-24 7:20 UTC (permalink / raw)
To: ocfs2-devel
We have found a BUG on res->migration_pending when migrating
lock resources. The situation is as follows.
dlm_mark_lockres_migration
res->migration_pending = 1;
__dlm_lockres_reserve_ast
dlm_lockres_release_ast returns with res->migration_pending remains
because other threads reserve asts
wait dlm_migration_can_proceed returns 1
>>>>>>> o2hb found that target goes down and remove target
from domain_map
dlm_migration_can_proceed returns 1
dlm_mark_lockres_migrating returns -ESHOTDOWN with
res->migration_pending still remains.
When reentering dlm_mark_lockres_migrating(), it will trigger
the BUG_ON with res->migration_pending. So clear migration_pending
when target is down.
Signed-off-by: Jiufei Xue <xuejiufei@huawei.com>
---
fs/ocfs2/dlm/dlmmaster.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index c43da7f..936e11b 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -2843,6 +2843,8 @@ again:
res->state &= ~DLM_LOCK_RES_BLOCK_DIRTY;
if (!ret)
BUG_ON(!(res->state & DLM_LOCK_RES_MIGRATING));
+ else
+ res->migration_pending = 0;
spin_unlock(&res->spinlock);
/*
--
1.8.4.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Ocfs2-devel] [PATCH V2] ocfs2/dlm: clear migration_pending when migration target goes down
2015-12-24 7:20 [Ocfs2-devel] [PATCH V2] ocfs2/dlm: clear migration_pending when migration target goes down xuejiufei
@ 2015-12-24 7:48 ` Joseph Qi
0 siblings, 0 replies; 2+ messages in thread
From: Joseph Qi @ 2015-12-24 7:48 UTC (permalink / raw)
To: ocfs2-devel
On 2015/12/24 15:20, xuejiufei wrote:
> We have found a BUG on res->migration_pending when migrating
> lock resources. The situation is as follows.
>
> dlm_mark_lockres_migration
> res->migration_pending = 1;
> __dlm_lockres_reserve_ast
> dlm_lockres_release_ast returns with res->migration_pending remains
> because other threads reserve asts
> wait dlm_migration_can_proceed returns 1
> >>>>>>> o2hb found that target goes down and remove target
> from domain_map
> dlm_migration_can_proceed returns 1
> dlm_mark_lockres_migrating returns -ESHOTDOWN with
> res->migration_pending still remains.
>
> When reentering dlm_mark_lockres_migrating(), it will trigger
> the BUG_ON with res->migration_pending. So clear migration_pending
> when target is down.
>
> Signed-off-by: Jiufei Xue <xuejiufei@huawei.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
> ---
> fs/ocfs2/dlm/dlmmaster.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
> index c43da7f..936e11b 100644
> --- a/fs/ocfs2/dlm/dlmmaster.c
> +++ b/fs/ocfs2/dlm/dlmmaster.c
> @@ -2843,6 +2843,8 @@ again:
> res->state &= ~DLM_LOCK_RES_BLOCK_DIRTY;
> if (!ret)
> BUG_ON(!(res->state & DLM_LOCK_RES_MIGRATING));
> + else
> + res->migration_pending = 0;
> spin_unlock(&res->spinlock);
>
> /*
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-12-24 7:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-24 7:20 [Ocfs2-devel] [PATCH V2] ocfs2/dlm: clear migration_pending when migration target goes down xuejiufei
2015-12-24 7:48 ` Joseph Qi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.