)]}'
{
  "commit": "341f741f04beceebcb30daa12ae2e5e52e64e532",
  "tree": "4c49b19c44fd13d26a2a84264aa062b07b911498",
  "parents": [
    "210f035316f545e6f507e7d61e191495ba983e27"
  ],
  "author": {
    "name": "David Howells",
    "email": "dhowells@redhat.com",
    "time": "Thu Jan 05 10:38:36 2017 +0000"
  },
  "committer": {
    "name": "David Howells",
    "email": "dhowells@redhat.com",
    "time": "Mon Jan 09 11:10:02 2017 +0000"
  },
  "message": "afs: Refcount the afs_call struct\n\nA static checker warning occurs in the AFS filesystem:\n\n\tfs/afs/cmservice.c:155 SRXAFSCB_CallBack()\n\terror: dereferencing freed memory \u0027call\u0027\n\ndue to the reply being sent before we access the server it points to.  The\nact of sending the reply causes the call to be freed if an error occurs\n(but not if it doesn\u0027t).\n\nOn top of this, the lifetime handling of afs_call structs is fragile\nbecause they get passed around through workqueues without any sort of\nrefcounting.\n\nDeal with the issues by:\n\n (1) Fix the maybe/maybe not nature of the reply sending functions with\n     regards to whether they release the call struct.\n\n (2) Refcount the afs_call struct and sort out places that need to get/put\n     references.\n\n (3) Pass a ref through the work queue and release (or pass on) that ref in\n     the work function.  Care has to be taken because a work queue may\n     already own a ref to the call.\n\n (4) Do the cleaning up in the put function only.\n\n (5) Simplify module cleanup by always incrementing afs_outstanding_calls\n     whenever a call is allocated.\n\n (6) Set the backlog to 0 with kernel_listen() at the beginning of the\n     process of closing the socket to prevent new incoming calls from\n     occurring and to remove the contribution of preallocated calls from\n     afs_outstanding_calls before we wait on it.\n\nA tracepoint is also added to monitor the afs_call refcount and lifetime.\n\nReported-by: Dan Carpenter \u003cdan.carpenter@oracle.com\u003e\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\nFixes: 08e0e7c82eea: \"[AF_RXRPC]: Make the in-kernel AFS filesystem use AF_RXRPC.\"\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "a2e1e02005f67f7588db76549b0eaf614e330921",
      "old_mode": 33188,
      "old_path": "fs/afs/cmservice.c",
      "new_id": "e349a3316303f8b327c237dc421fdba725e1d735",
      "new_mode": 33188,
      "new_path": "fs/afs/cmservice.c"
    },
    {
      "type": "modify",
      "old_id": "b411670d5f6770667f128fa3c859f3ae88636eb9",
      "old_mode": 33188,
      "old_path": "fs/afs/internal.h",
      "new_id": "65504e218d35f78cee408f4e9263d3005d6fdf4c",
      "new_mode": 33188,
      "new_path": "fs/afs/internal.h"
    },
    {
      "type": "modify",
      "old_id": "ec1e41f929d13a972922688808690b0cb8b1afed",
      "old_mode": 33188,
      "old_path": "fs/afs/rxrpc.c",
      "new_id": "95f42872b787ad8f857890b60a581b741f12dfc2",
      "new_mode": 33188,
      "new_path": "fs/afs/rxrpc.c"
    },
    {
      "type": "modify",
      "old_id": "845907b04ff442f1457dee0987088c0308d30eb1",
      "old_mode": 33188,
      "old_path": "include/trace/events/afs.h",
      "new_id": "8b95c16b70454ac875ef5ee3ff8d9df16b78e48b",
      "new_mode": 33188,
      "new_path": "include/trace/events/afs.h"
    }
  ]
}
