]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ocfs2/dlm: clear migration_pending when migration target goes down
authorxuejiufei <xuejiufei@huawei.com>
Tue, 29 Dec 2015 22:54:29 +0000 (14:54 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Sat, 26 Nov 2016 23:43:22 +0000 (15:43 -0800)
commit86ebd154b0e7a92cd809a3868d7f0f8ddd70ecfe
treef312e170a835b1db9223da2507b3d9b833c65894
parent4c80d2127bfdded789db2aee5fead2f9a917d373
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 <xuejiufei@huawei.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit cc28d6d80f6ab494b10f0e2ec949eacd610f66e3)

Orabug: 24939243

Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
fs/ocfs2/dlm/dlmmaster.c