)]}'
{
  "commit": "2b833595aa21679145cfe67ba720113b165c19ef",
  "tree": "a4e4f9de6b678e127be98be4a6057355c9f3901f",
  "parents": [
    "a1ea8eb5912256c0b2be16fae5d3786aebc80cb1"
  ],
  "author": {
    "name": "Fiona Ebner",
    "email": "f.ebner@proxmox.com",
    "time": "Fri May 30 17:10:47 2025 +0200"
  },
  "committer": {
    "name": "Kevin Wolf",
    "email": "kwolf@redhat.com",
    "time": "Wed Jun 04 18:16:34 2025 +0200"
  },
  "message": "block: move drain outside of bdrv_attach_child_common(_abort)()\n\nThis is part of resolving the deadlock mentioned in commit \"block:\nmove draining out of bdrv_change_aio_context() and mark GRAPH_RDLOCK\".\n\nThe function bdrv_attach_child_common_abort() is used only as the\nabort callback in bdrv_attach_child_common_drv transactions, so the\ntran_finalize() calls of such transactions need to be in drained\nsections too.\n\nAll code paths are covered:\nThe bdrv_attach_child_common_drv transactions are only used in\nbdrv_attach_child_common(), so it is enough to check callers of\nbdrv_attach_child_common() following the transactions.\n\nbdrv_attach_child_common() is called by:\n1. bdrv_attach_child_noperm(), which does not finalize the\n   transaction yet.\n2. bdrv_root_attach_child(), where a drained section is introduced.\n\nbdrv_attach_child_noperm() is called by:\n1. bdrv_attach_child(), where a drained section is introduced.\n2. bdrv_set_file_or_backing_noperm(), which does not finalize the\n   transaction yet.\n3. bdrv_append(), where a drained section is introduced.\n\nbdrv_set_file_or_backing_noperm() is called by:\n1. bdrv_set_backing_hd_drained(), where a drained section is\n   introduced.\n2. bdrv_reopen_parse_file_or_backing(), which does not finalize the\n   transaction yet. Draining the old child bs currently happens under\n   the graph lock there. This is replaced with an assertion, because\n   the drain will be moved further up to the caller.\n\nbdrv_reopen_parse_file_or_backing() is called by:\n1. bdrv_reopen_prepare(), which does not finalize the transaction yet.\n\nbdrv_reopen_prepare() is called by:\n1. bdrv_reopen_multiple(), which does finalize the transaction. It is\n   called after bdrv_reopen_queue(), which starts a drained section.\n   The drained section ends, when bdrv_reopen_queue_free() is called\n   at the end of bdrv_reopen_multiple().\n\nThis resolves all code paths.\n\nThe functions bdrv_set_backing_hd_drained(), bdrv_attach_child() and\nbdrv_root_attach_child() run under the graph lock, so they are not\nactually allowed to drain. This will be addressed in the following\ncommits.\n\nSigned-off-by: Fiona Ebner \u003cf.ebner@proxmox.com\u003e\nMessage-ID: \u003c20250530151125.955508-11-f.ebner@proxmox.com\u003e\nReviewed-by: Kevin Wolf \u003ckwolf@redhat.com\u003e\nSigned-off-by: Kevin Wolf \u003ckwolf@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "3aaacabf7f39a408005433289754edeea5aa1d52",
      "old_mode": 33188,
      "old_path": "block.c",
      "new_id": "46eb2fe449ceee65317fbbf01b643f67eb2151b3",
      "new_mode": 33188,
      "new_path": "block.c"
    }
  ]
}
