)]}'
{
  "commit": "aa9bca05a467c61dcea4142b2877d5392de5bdce",
  "tree": "ad269fed4d1f2f3c40e3adab9ea46162ebf59fe9",
  "parents": [
    "e9cdd6e771580e6ff872e5c64e8b766972c7d1bc"
  ],
  "author": {
    "name": "Weijie Yang",
    "email": "weijie.yang@samsung.com",
    "time": "Wed Oct 16 13:46:54 2013 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Wed Oct 16 21:35:52 2013 -0700"
  },
  "message": "mm/zswap: bugfix: memory leak when re-swapon\n\nzswap_tree is not freed when swapoff, and it got re-kmalloced in swapon,\nso a memory leak occurs.\n\nFree the memory of zswap_tree in zswap_frontswap_invalidate_area().\n\nSigned-off-by: Weijie Yang \u003cweijie.yang@samsung.com\u003e\nReviewed-by: Bob Liu \u003cbob.liu@oracle.com\u003e\nCc: Minchan Kim \u003cminchan@kernel.org\u003e\nReviewed-by: Minchan Kim \u003cminchan@kernel.org\u003e\nCc: \u003cstable@vger.kernel.org\u003e\nFrom: Weijie Yang \u003cweijie.yang@samsung.com\u003e\nSubject: mm/zswap: bugfix: memory leak when invalidate and reclaim occur concurrently\n\nConsider the following scenario:\nthread 0: reclaim entry x (get refcount, but not call zswap_get_swap_cache_page)\nthread 1: call zswap_frontswap_invalidate_page to invalidate entry x.\n\tfinished, entry x and its zbud is not freed as its refcount !\u003d 0\n\tnow, the swap_map[x] \u003d 0\nthread 0: now call zswap_get_swap_cache_page\n\tswapcache_prepare return -ENOENT because entry x is not used any more\n\tzswap_get_swap_cache_page return ZSWAP_SWAPCACHE_NOMEM\n\tzswap_writeback_entry do nothing except put refcount\nNow, the memory of zswap_entry x and its zpage leak.\n\nModify:\n - check the refcount in fail path, free memory if it is not referenced.\n\n - use ZSWAP_SWAPCACHE_FAIL instead of ZSWAP_SWAPCACHE_NOMEM as the fail path\n   can be not only caused by nomem but also by invalidate.\n\n[akpm@linux-foundation.org: coding-style fixes]\nSigned-off-by: Weijie Yang \u003cweijie.yang@samsung.com\u003e\nReviewed-by: Bob Liu \u003cbob.liu@oracle.com\u003e\nCc: Minchan Kim \u003cminchan@kernel.org\u003e\nCc: \u003cstable@vger.kernel.org\u003e\nAcked-by: Seth Jennings \u003csjenning@linux.vnet.ibm.com\u003e\n\nSigned-off-by: Andrew Morton \u003cakpm@linux-foundation.org\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "841e35f1db22caff3afd03c104403f0c744776cb",
      "old_mode": 33188,
      "old_path": "mm/zswap.c",
      "new_id": "d93510c6aa2da860d779570cbf0a4c7cee278ad5",
      "new_mode": 33188,
      "new_path": "mm/zswap.c"
    }
  ]
}
