)]}'
{
  "commit": "1be507397afd88ff725e64f4353f98fe337d3979",
  "tree": "8f94676863bdf93874670e5a75c0e002783d2f03",
  "parents": [
    "00c78dee7f5e4ffa7cfba4e51e363a163dd89320"
  ],
  "author": {
    "name": "Josef Bacik",
    "email": "josef@toxicpanda.com",
    "time": "Mon Oct 21 12:19:37 2019 -0400"
  },
  "committer": {
    "name": "Josef Bacik",
    "email": "josef@toxicpanda.com",
    "time": "Mon Oct 21 12:32:53 2019 -0400"
  },
  "message": "nbd: handle racing with error\u0027ed out commands\n\nWe hit the following warning in production\n\nprint_req_error: I/O error, dev nbd0, sector 7213934408 flags 80700\n------------[ cut here ]------------\nrefcount_t: underflow; use-after-free.\nWARNING: CPU: 25 PID: 32407 at lib/refcount.c:190 refcount_sub_and_test_checked+0x53/0x60\nWorkqueue: knbd-recv recv_work [nbd]\nRIP: 0010:refcount_sub_and_test_checked+0x53/0x60\nCall Trace:\n blk_mq_free_request+0xb7/0xf0\n blk_mq_complete_request+0x62/0xf0\n recv_work+0x29/0xa1 [nbd]\n process_one_work+0x1f5/0x3f0\n worker_thread+0x2d/0x3d0\n ? rescuer_thread+0x340/0x340\n kthread+0x111/0x130\n ? kthread_create_on_node+0x60/0x60\n ret_from_fork+0x1f/0x30\n---[ end trace b079c3c67f98bb7c ]---\n\nThis was preceded by us timing out everything and shutting down the\nsockets for the device.  The problem is we had a request in the queue at\nthe same time, so we completed the request twice.  This can actually\nhappen in a lot of cases, we fail to get a ref on our config, we only\nhave one connection and just error out the command, etc.\n\nFix this by checking cmd-\u003estatus in nbd_read_stat.  We only change this\nunder the cmd-\u003elock, so we are safe to check this here and see if we\u0027ve\nalready error\u0027ed this command out, which would indicate that we\u0027ve\ncompleted it as well.\n\nSigned-off-by: Josef Bacik \u003cjosef@toxicpanda.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8fb8913074b80c8132db2bb34e3dd9d807d4c4cc",
      "old_mode": 33188,
      "old_path": "drivers/block/nbd.c",
      "new_id": "e9f5d4e476e77f941168b74bb237116a6055fd1e",
      "new_mode": 33188,
      "new_path": "drivers/block/nbd.c"
    }
  ]
}
