)]}'
{
  "commit": "8a2bfdcbfa441d8b0e5cb9c9a7f45f77f80da465",
  "tree": "10c90347c8eaf6dcad69b74198c535c2febd3387",
  "parents": [
    "1463fdbcc797dfcb8574ababbd39cf6205f6ed00"
  ],
  "author": {
    "name": "Mingming Cao",
    "email": "cmm@us.ibm.com",
    "time": "Wed Feb 28 20:13:35 2007 -0800"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@woody.linux-foundation.org",
    "time": "Thu Mar 01 14:53:38 2007 -0800"
  },
  "message": "[PATCH] ext[34]: EA block reference count racing fix\n\nThere are race issues around ext[34] xattr block release code.\n\next[34]_xattr_release_block() checks the reference count of xattr block\n(h_refcount) and frees that xattr block if it is the last one reference it.\n Unlike ext2, the check of this counter is unprotected by any lock.\next[34]_xattr_release_block() will free the mb_cache entry before freeing\nthat xattr block.  There is a small window between the check for the re\nh_refcount \u003d\u003d1 and the call to mb_cache_entry_free().  During this small\nwindow another inode might find this xattr block from the mbcache and reuse\nit, racing a refcount updates.  The xattr block will later be freed by the\nfirst inode without notice other inode is still use it.  Later if that\nblock is reallocated as a datablock for other file, then more serious\nproblem might happen.\n\nWe need put a lock around places checking the refount as well to avoid\nracing issue.  Another place need this kind of protection is in\next3_xattr_block_set(), where it will modify the xattr block content in-\nthe-fly if the refcount is 1 (means it\u0027s the only inode reference it).\n\nThis will also fix another issue: the xattr block may not get freed at all\nif no lock is to protect the refcount check at the release time.  It is\npossible that the last two inodes could release the shared xattr block at\nthe same time.  But both of them think they are not the last one so only\ndecreased the h_refcount without freeing xattr block at all.\n\nWe need to call lock_buffer() after ext3_journal_get_write_access() to\navoid deadlock (because the later will call lock_buffer()/unlock_buffer\n() as well).\n\nSigned-off-by: Mingming Cao \u003ccmm@us.ibm.com\u003e\nCc: Andreas Gruenbacher \u003cagruen@suse.de\u003e\nCc: \u003clinux-ext4@vger.kernel.org\u003e\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": "99857a400f4be217dcf92e5f16ac6c62783b62e2",
      "old_mode": 33188,
      "old_path": "fs/ext3/xattr.c",
      "new_id": "12f7dda1232cb8b17749d6f3e87d6ea77a40bb0c",
      "new_mode": 33188,
      "new_path": "fs/ext3/xattr.c"
    },
    {
      "type": "modify",
      "old_id": "dc969c357aa1d4ef9e207054e506053b8efdc0c6",
      "old_mode": 33188,
      "old_path": "fs/ext4/xattr.c",
      "new_id": "e832e96095b33c177e880db6370e1686153439f6",
      "new_mode": 33188,
      "new_path": "fs/ext4/xattr.c"
    }
  ]
}
