)]}'
{
  "commit": "2ac8a0f58a8782ff8024404a579eee260e8b2010",
  "tree": "b3712f056d64c6a4b1ce7b506fd96d2d59ba6896",
  "parents": [
    "1c8f63c2758096c3b6425f4ecb274901151d6f17"
  ],
  "author": {
    "name": "NeilBrown",
    "email": "neilb@suse.de",
    "time": "Thu Jul 19 15:59:18 2012 +1000"
  },
  "committer": {
    "name": "Greg Kroah-Hartman",
    "email": "gregkh@linuxfoundation.org",
    "time": "Sun Jul 29 08:04:17 2012 -0700"
  },
  "message": "md: avoid crash when stopping md array races with closing other open fds.\n\ncommit a05b7ea03d72f36edb0cec05e8893803335c61a0 upstream.\n\nmd will refuse to stop an array if any other fd (or mounted fs) is\nusing it.\nWhen any fs is unmounted of when the last open fd is closed all\npending IO will be flushed (e.g. sync_blockdev call in __blkdev_put)\nso there will be no pending IO to worry about when the array is\nstopped.\n\nHowever in order to send the STOP_ARRAY ioctl to stop the array one\nmust first get and open fd on the block device.\nIf some fd is being used to write to the block device and it is closed\nafter mdadm open the block device, but before mdadm issues the\nSTOP_ARRAY ioctl, then there will be no last-close on the md device so\n__blkdev_put will not call sync_blockdev.\n\nIf this happens, then IO can still be in-flight while md tears down\nthe array and bad things can happen (use-after-free and subsequent\nhavoc).\n\nSo in the case where do_md_stop is being called from an open file\ndescriptor, call sync_block after taking the mutex to ensure there\nwill be no new openers.\n\nThis is needed when setting a read-write device to read-only too.\n\nReported-by: majianpeng \u003cmajianpeng@gmail.com\u003e\nSigned-off-by: NeilBrown \u003cneilb@suse.de\u003e\nSigned-off-by: Greg Kroah-Hartman \u003cgregkh@linuxfoundation.org\u003e\n\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2b30ffdb81b234b73205e5c7fa211eb805cd763b",
      "old_mode": 33188,
      "old_path": "drivers/md/md.c",
      "new_id": "9ee8ce3e9650983336ba55fd2b3a6c64957000a6",
      "new_mode": 33188,
      "new_path": "drivers/md/md.c"
    }
  ]
}
