Skip to content

Commit cc28d6d

Browse files
xuejiufeitorvalds
authored andcommitted
ocfs2/dlm: clear migration_pending when migration target goes down
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 <[email protected]> Reviewed-by: Joseph Qi <[email protected]> Cc: Mark Fasheh <[email protected]> Cc: Joel Becker <[email protected]> Cc: Junxiao Bi <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 5f0f288 commit cc28d6d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/ocfs2/dlm/dlmmaster.c

+2
Original file line numberDiff line numberDiff line change
@@ -2843,6 +2843,8 @@ static int dlm_mark_lockres_migrating(struct dlm_ctxt *dlm,
28432843
res->state &= ~DLM_LOCK_RES_BLOCK_DIRTY;
28442844
if (!ret)
28452845
BUG_ON(!(res->state & DLM_LOCK_RES_MIGRATING));
2846+
else
2847+
res->migration_pending = 0;
28462848
spin_unlock(&res->spinlock);
28472849

28482850
/*

0 commit comments

Comments
 (0)