)]}'
{
  "commit": "152becd26e0563aefdbc4fd1fe491928efe92d1f",
  "tree": "713a5ff0a1610708babf7e57fd3141cd4b9f183e",
  "parents": [
    "9a59f452abe11f569e13ec16c51e6d61c54b9838"
  ],
  "author": {
    "name": "Anton Altaparmakov",
    "email": "aia21@cam.ac.uk",
    "time": "Thu Jun 23 00:10:21 2005 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@ppc970.osdl.org",
    "time": "Thu Jun 23 09:45:34 2005 -0700"
  },
  "message": "[PATCH] Bug in error recovery in fs/buffer.c::__block_prepare_write()\n\nfs/buffer.c::__block_prepare_write() has broken error recovery.  It calls\nthe get_block() callback with \"create \u003d 1\" and if that succeeds it\nimmediately clears buffer_new on the just allocated buffer (which has\nbuffer_new set).\n\nThe bug is that if an error occurs and get_block() returns !\u003d 0, we break\nfrom this loop and go into recovery code.  This code has this comment:\n\n/* Error case: */\n/*\n * Zero out any newly allocated blocks to avoid exposing stale\n * data.  If BH_New is set, we know that the block was newly\n * allocated in the above loop.\n */\n\nSo the intent is obviously good in that it wants to clear just allocated\nand hence not zeroed buffers.  However the code recognises allocated\nbuffers by checking for buffer_new being set.\n\nUnfortunately __block_prepare_write() as discussed above already cleared\nbuffer_new on all allocated buffers thus no buffers will be cleared during\nerror recovery and old data will be leaked.\n\nThe simplest way I can see to fix this is to make the current recovery code\nwork by _not_ clearing buffer_new after calling get_block() in\n__block_prepare_write().\n\nWe cannot safely allow buffer_new buffers to \"leak out\" of\n__block_prepare_write(), thus we simply do a quick loop over the buffers\nclearing buffer_new on each of them if it is set just before returning\n\"success\" from __block_prepare_write().\n\nSigned-off-by: Anton Altaparmakov \u003caia21@cantab.net\u003e\nSigned-off-by: Andrew Morton \u003cakpm@osdl.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@osdl.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "12bdb27911271202174ba43abcc789ed7eefccf0",
      "old_mode": 33188,
      "old_path": "fs/buffer.c",
      "new_id": "13e5938a64f6338072e06c16ad8b73e366cad024",
      "new_mode": 33188,
      "new_path": "fs/buffer.c"
    }
  ]
}
