)]}'
{
  "commit": "1bccf513ac49d44604ba1cddcc29f5886e70f1b6",
  "tree": "096ba75a3d02018c5f6e1857aaf1d41471733850",
  "parents": [
    "6897e3df8fc37bd4a58bbcdef8306da7fc175584"
  ],
  "author": {
    "name": "David Howells",
    "email": "dhowells@redhat.com",
    "time": "Thu Nov 19 18:11:25 2009 +0000"
  },
  "committer": {
    "name": "David Howells",
    "email": "dhowells@redhat.com",
    "time": "Thu Nov 19 18:11:25 2009 +0000"
  },
  "message": "FS-Cache: Fix lock misorder in fscache_write_op()\n\nFS-Cache has two structs internally for keeping track of the internal state of\na cached file: the fscache_cookie struct, which represents the netfs\u0027s state,\nand fscache_object struct, which represents the cache\u0027s state.  Each has a\npointer that points to the other (when both are in existence), and each has a\nspinlock for pointer maintenance.\n\nSince netfs operations approach these structures from the cookie side, they get\nthe cookie lock first, then the object lock.  Cache operations, on the other\nhand, approach from the object side, and get the object lock first.  It is not\nthen permitted for a cache operation to get the cookie lock whilst it is\nholding the object lock lest deadlock occur; instead, it must do one of two\nthings:\n\n (1) increment the cookie usage counter, drop the object lock and then get both\n     locks in order, or\n\n (2) simply hold the object lock as certain parts of the cookie may not be\n     altered whilst the object lock is held.\n\nIt is also not permitted to follow either pointer without holding the lock at\nthe end you start with.  To break the pointers between the cookie and the\nobject, both locks must be held.\n\nfscache_write_op(), however, violates the locking rules: It attempts to get the\ncookie lock without (a) checking that the cookie pointer is a valid pointer,\nand (b) holding the object lock to protect the cookie pointer whilst it follows\nit.  This is so that it can access the pending page store tree without\ninterference from __fscache_write_page().\n\nThis is fixed by splitting the cookie lock, such that the page store tracking\ntree is protected by its own lock, and checking that the cookie pointer is\nnon-NULL before we attempt to follow it whilst holding the object lock.\n\nThe new lock is subordinate to both the cookie lock and the object lock, and so\nshould be taken after those.\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "0a77868f4977f28d16129843b908f27765020864",
      "old_mode": 33188,
      "old_path": "Documentation/filesystems/caching/fscache.txt",
      "new_id": "9cf2cfbc81c98f95e211e6982e1ed123d0d5d4ef",
      "new_mode": 33188,
      "new_path": "Documentation/filesystems/caching/fscache.txt"
    },
    {
      "type": "modify",
      "old_id": "e6854f5222f5240c4e8a04d9c0dfbce98865f8b5",
      "old_mode": 33188,
      "old_path": "fs/fscache/cookie.c",
      "new_id": "f979659c1b3fa6094e4901641b4485c94b014c71",
      "new_mode": 33188,
      "new_path": "fs/fscache/cookie.c"
    },
    {
      "type": "modify",
      "old_id": "50324ad2b1941ca1ad53d375673df87a6ff3dd9e",
      "old_mode": 33188,
      "old_path": "fs/fscache/internal.h",
      "new_id": "ba1853fa1ff93934fad9926055fa3326fb92d2cd",
      "new_mode": 33188,
      "new_path": "fs/fscache/internal.h"
    },
    {
      "type": "modify",
      "old_id": "e6f2e61133a140273edd4de253c65cec705caa09",
      "old_mode": 33188,
      "old_path": "fs/fscache/page.c",
      "new_id": "3ea8897bc21762ae6f7ada8b6f0eed3b368fcd58",
      "new_mode": 33188,
      "new_path": "fs/fscache/page.c"
    },
    {
      "type": "modify",
      "old_id": "4c07439d13077bddbc7e595f3d01a3f610cb1f1c",
      "old_mode": 33188,
      "old_path": "fs/fscache/stats.c",
      "new_id": "1d53ea68409e437d29165b8c35c8214a2eedb6aa",
      "new_mode": 33188,
      "new_path": "fs/fscache/stats.c"
    },
    {
      "type": "modify",
      "old_id": "184cbdfbcc992cc5e2dd234d8cc9a96162dcb68e",
      "old_mode": 33188,
      "old_path": "include/linux/fscache-cache.h",
      "new_id": "f3aa4bdafef6b946290013c62ab10f563f73c0e5",
      "new_mode": 33188,
      "new_path": "include/linux/fscache-cache.h"
    }
  ]
}
