)]}'
{
  "commit": "15870706456d9d0d32b2541b967df9119bdda1de",
  "tree": "a49a3491507852431eb7419826689f816d58400f",
  "parents": [
    "a8addb5ef92d396f6b548d6de1863e7b212b6ab5"
  ],
  "author": {
    "name": "Johannes Weiner",
    "email": "hannes@cmpxchg.org",
    "time": "Thu Jan 08 14:32:18 2015 -0800"
  },
  "committer": {
    "name": "William Bellavance",
    "email": "flintman@flintmancomputers.com",
    "time": "Wed Feb 10 20:00:41 2016 -0500"
  },
  "message": "mm: protect set_page_dirty() from ongoing truncation\n\ncommit 2d6d7f98284648c5ed113fe22a132148950b140f upstream.\n\nTejun, while reviewing the code, spotted the following race condition\nbetween the dirtying and truncation of a page:\n\n__set_page_dirty_nobuffers()       __delete_from_page_cache()\n  if (TestSetPageDirty(page))\n                                     page-\u003emapping \u003d NULL\n\t\t\t\t     if (PageDirty())\n\t\t\t\t       dec_zone_page_state(page, NR_FILE_DIRTY);\n\t\t\t\t       dec_bdi_stat(mapping-\u003ebacking_dev_info, BDI_RECLAIMABLE);\n    if (page-\u003emapping)\n      account_page_dirtied(page)\n        __inc_zone_page_state(page, NR_FILE_DIRTY);\n\t__inc_bdi_stat(mapping-\u003ebacking_dev_info, BDI_RECLAIMABLE);\n\nwhich results in an imbalance of NR_FILE_DIRTY and BDI_RECLAIMABLE.\n\nDirtiers usually lock out truncation, either by holding the page lock\ndirectly, or in case of zap_pte_range(), by pinning the mapcount with\nthe page table lock held.  The notable exception to this rule, though,\nis do_wp_page(), for which this race exists.  However, do_wp_page()\nalready waits for a locked page to unlock before setting the dirty bit,\nin order to prevent a race where clear_page_dirty() misses the page bit\nin the presence of dirty ptes.  Upgrade that wait to a fully locked\nset_page_dirty() to also cover the situation explained above.\n\nAfterwards, the code in set_page_dirty() dealing with a truncation race\nis no longer needed.  Remove it.\n\nReported-by: Tejun Heo \u003ctj@kernel.org\u003e\nSigned-off-by: Johannes Weiner \u003channes@cmpxchg.org\u003e\nAcked-by: Kirill A. Shutemov \u003ckirill.shutemov@linux.intel.com\u003e\nReviewed-by: Jan Kara \u003cjack@suse.cz\u003e\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n[lizf: Backported to 3.4:\n - adjust context\n - use VM_BUG_ON() instead of VM_BUG_ON_PAGE()]\nSigned-off-by: Zefan Li \u003clizefan@huawei.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "a2b84f598e2b1a3068c3c4ec422df05dcf094d6a",
      "old_mode": 33188,
      "old_path": "include/linux/writeback.h",
      "new_id": "dd8d4918de2e12ac87632e1b96906b4da23aed3e",
      "new_mode": 33188,
      "new_path": "include/linux/writeback.h"
    },
    {
      "type": "modify",
      "old_id": "f715124932ba1f79bfa1e8f9e61adc625673e3db",
      "old_mode": 33188,
      "old_path": "mm/memory.c",
      "new_id": "80b9cd353e38762b8a3c12830c1da5592b0b4946",
      "new_mode": 33188,
      "new_path": "mm/memory.c"
    },
    {
      "type": "modify",
      "old_id": "e696d5e7b4f833c45d1409309acfa3291df8a247",
      "old_mode": 33188,
      "old_path": "mm/page-writeback.c",
      "new_id": "0a49a2f8de3aa8f7f6a32efed864df7f4a14637d",
      "new_mode": 33188,
      "new_path": "mm/page-writeback.c"
    }
  ]
}
