)]}'
{
  "commit": "ac7cf246dfdbec3d8fed296c7bf30e16f5099dac",
  "tree": "685e1bf6903a2fbf67911fc6f349e3c3e81ce773",
  "parents": [
    "28888681b4f641ce9a96478ce4683577cd3abbff"
  ],
  "author": {
    "name": "Joseph Qi",
    "email": "joseph.qi@huawei.com",
    "time": "Fri Mar 25 14:21:26 2016 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Fri Mar 25 16:37:42 2016 -0700"
  },
  "message": "ocfs2/dlm: fix race between convert and recovery\n\nThere is a race window between dlmconvert_remote and\ndlm_move_lockres_to_recovery_list, which will cause a lock with\nOCFS2_LOCK_BUSY in grant list, thus system hangs.\n\ndlmconvert_remote\n{\n        spin_lock(\u0026res-\u003espinlock);\n        list_move_tail(\u0026lock-\u003elist, \u0026res-\u003econverting);\n        lock-\u003econvert_pending \u003d 1;\n        spin_unlock(\u0026res-\u003espinlock);\n\n        status \u003d dlm_send_remote_convert_request();\n        \u003e\u003e\u003e\u003e\u003e\u003e race window, master has queued ast and return DLM_NORMAL,\n               and then down before sending ast.\n               this node detects master down and calls\n               dlm_move_lockres_to_recovery_list, which will revert the\n               lock to grant list.\n               Then OCFS2_LOCK_BUSY won\u0027t be cleared as new master won\u0027t\n               send ast any more because it thinks already be authorized.\n\n        spin_lock(\u0026res-\u003espinlock);\n        lock-\u003econvert_pending \u003d 0;\n        if (status !\u003d DLM_NORMAL)\n                dlm_revert_pending_convert(res, lock);\n        spin_unlock(\u0026res-\u003espinlock);\n}\n\nIn this case, check if res-\u003estate has DLM_LOCK_RES_RECOVERING bit set\n(res is still in recovering) or res master changed (new master has\nfinished recovery), reset the status to DLM_RECOVERING, then it will\nretry convert.\n\nSigned-off-by: Joseph Qi \u003cjoseph.qi@huawei.com\u003e\nReported-by: Yiwen Jiang \u003cjiangyiwen@huawei.com\u003e\nReviewed-by: Junxiao Bi \u003cjunxiao.bi@oracle.com\u003e\nCc: Mark Fasheh \u003cmfasheh@suse.de\u003e\nCc: Joel Becker \u003cjlbec@evilplan.org\u003e\nCc: Tariq Saeed \u003ctariq.x.saeed@oracle.com\u003e\nCc: Junxiao Bi \u003cjunxiao.bi@oracle.com\u003e\nCc: \u003cstable@vger.kernel.org\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e36d63ff17830bf321a1809d1b81a87827290037",
      "old_mode": 33188,
      "old_path": "fs/ocfs2/dlm/dlmconvert.c",
      "new_id": "84de55ed865a015d79b30c33d765165c98a800df",
      "new_mode": 33188,
      "new_path": "fs/ocfs2/dlm/dlmconvert.c"
    }
  ]
}
