)]}'
{
  "commit": "97b8ee845393701edc06e27ccec2876ff9596019",
  "tree": "9199f88fc151198208e20ec7f1ec596707c24ea6",
  "parents": [
    "f0160a5a2912267c02cfe692eac955c360de5fdf"
  ],
  "author": {
    "name": "Martin Lau",
    "email": "kafai@fb.com",
    "time": "Mon Jun 09 23:06:42 2014 -0700"
  },
  "committer": {
    "name": "Steven Rostedt",
    "email": "rostedt@goodmis.org",
    "time": "Tue Jul 15 17:07:47 2014 -0400"
  },
  "message": "ring-buffer: Fix polling on trace_pipe\n\nring_buffer_poll_wait() should always put the poll_table to its wait_queue\neven there is immediate data available.  Otherwise, the following epoll and\nread sequence will eventually hang forever:\n\n1. Put some data to make the trace_pipe ring_buffer read ready first\n2. epoll_ctl(efd, EPOLL_CTL_ADD, trace_pipe_fd, ee)\n3. epoll_wait()\n4. read(trace_pipe_fd) till EAGAIN\n5. Add some more data to the trace_pipe ring_buffer\n6. epoll_wait() -\u003e this epoll_wait() will block forever\n\n~ During the epoll_ctl(efd, EPOLL_CTL_ADD,...) call in step 2,\n  ring_buffer_poll_wait() returns immediately without adding poll_table,\n  which has poll_table-\u003e_qproc pointing to ep_poll_callback(), to its\n  wait_queue.\n~ During the epoll_wait() call in step 3 and step 6,\n  ring_buffer_poll_wait() cannot add ep_poll_callback() to its wait_queue\n  because the poll_table-\u003e_qproc is NULL and it is how epoll works.\n~ When there is new data available in step 6, ring_buffer does not know\n  it has to call ep_poll_callback() because it is not in its wait queue.\n  Hence, block forever.\n\nOther poll implementation seems to call poll_wait() unconditionally as the very\nfirst thing to do.  For example, tcp_poll() in tcp.c.\n\nLink: http://lkml.kernel.org/p/20140610060637.GA14045@devbig242.prn2.facebook.com\n\nCc: stable@vger.kernel.org # 2.6.27\nFixes: 2a2cc8f7c4d0 \"ftrace: allow the event pipe to be polled\"\nReviewed-by: Chris Mason \u003cclm@fb.com\u003e\nSigned-off-by: Martin Lau \u003ckafai@fb.com\u003e\nSigned-off-by: Steven Rostedt \u003crostedt@goodmis.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7c56c3d06943060d13ed611da638a09ccfa70ef4",
      "old_mode": 33188,
      "old_path": "kernel/trace/ring_buffer.c",
      "new_id": "ff7027199a9a32ea9281bca4e2049ebbb549dd38",
      "new_mode": 33188,
      "new_path": "kernel/trace/ring_buffer.c"
    }
  ]
}
