)]}'
{
  "commit": "24d406a6bf736f7aebdc8fa0f0ec86e0890c6d24",
  "tree": "3dfb2053f7785508304fd29d6c1bb6e6a42a7d5c",
  "parents": [
    "dbb3b1ca5609d1f3848cd387d06cc60aaacf7f98"
  ],
  "author": {
    "name": "Jiri Slaby",
    "email": "jslaby@suse.cz",
    "time": "Wed Aug 10 14:59:28 2011 +0200"
  },
  "committer": {
    "name": "Greg Kroah-Hartman",
    "email": "gregkh@suse.de",
    "time": "Tue Aug 23 10:10:38 2011 -0700"
  },
  "message": "TTY: pty, fix pty counting\n\ntty_operations-\u003eremove is normally called like:\nqueue_release_one_tty\n -\u003etty_shutdown\n   -\u003etty_driver_remove_tty\n     -\u003etty_operations-\u003eremove\n\nHowever tty_shutdown() is called from queue_release_one_tty() only if\ntty_operations-\u003eshutdown is NULL. But for pty, it is not.\npty_unix98_shutdown() is used there as -\u003eshutdown.\n\nSo tty_operations-\u003eremove of pty (i.e. pty_unix98_remove()) is never\ncalled. This results in invalid pty_count. I.e. what can be seen in\n/proc/sys/kernel/pty/nr.\n\nI see this was already reported at:\n  https://lkml.org/lkml/2009/11/5/370\nBut it was not fixed since then.\n\nThis patch is kind of a hackish way. The problem lies in -\u003einstall. We\nallocate there another tty (so-called tty-\u003elink). So -\u003einstall is\ncalled once, but -\u003eremove twice, for both tty and tty-\u003elink. The fix\nhere is to count both tty and tty-\u003elink and divide the count by 2 for\nuser.\n\nAnd to have -\u003eremove called, let\u0027s make tty_driver_remove_tty() global\nand call that from pty_unix98_shutdown() (tty_operations-\u003eshutdown).\n\nWhile at it, let\u0027s document that when -\u003eshutdown is defined,\ntty_shutdown() is not called.\n\nSigned-off-by: Jiri Slaby \u003cjslaby@suse.cz\u003e\nCc: Alan Cox \u003calan@linux.intel.com\u003e\nCc: \"H. Peter Anvin\" \u003chpa@zytor.com\u003e\nCc: stable \u003cstable@kernel.org\u003e\nSigned-off-by: Greg Kroah-Hartman \u003cgregkh@suse.de\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "98b6e3bdb000bda730a69a05680d76b8584f1715",
      "old_mode": 33188,
      "old_path": "drivers/tty/pty.c",
      "new_id": "e809e9d4683c6d82197cbd569c12b1375df8be99",
      "new_mode": 33188,
      "new_path": "drivers/tty/pty.c"
    },
    {
      "type": "modify",
      "old_id": "150e4f747c7dc4bc822a706a76d06afefb80424d",
      "old_mode": 33188,
      "old_path": "drivers/tty/tty_io.c",
      "new_id": "4f1fc81112e6b5ae6521e39cf19295e1f3a0c6b5",
      "new_mode": 33188,
      "new_path": "drivers/tty/tty_io.c"
    },
    {
      "type": "modify",
      "old_id": "44bc0c5617e1c227df1b3699dbdac1ac7dbab191",
      "old_mode": 33188,
      "old_path": "include/linux/tty.h",
      "new_id": "5f2ede82b3d67e5223089f6db9cec489267991ef",
      "new_mode": 33188,
      "new_path": "include/linux/tty.h"
    },
    {
      "type": "modify",
      "old_id": "9deeac85524078f0ef97b140f270c39391509f51",
      "old_mode": 33188,
      "old_path": "include/linux/tty_driver.h",
      "new_id": "ecdaeb98b293727274b6511ee7ef523c00324564",
      "new_mode": 33188,
      "new_path": "include/linux/tty_driver.h"
    }
  ]
}
