]> git.baikalelectronics.ru Git - kernel.git/commit
tty: fix up atime/mtime mess, take three
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 May 2013 14:32:21 +0000 (07:32 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 May 2013 14:32:21 +0000 (07:32 -0700)
commitef5924ea6915dbd05ec645ca1bf85706156a3938
tree1d9569036a89ad458fdc25f67a20fbf56a7cf340
parent0bf0b555afa8d0f683858abbb324d7317c153c46
tty: fix up atime/mtime mess, take three

We first tried to avoid updating atime/mtime entirely (commit
a2c1410fd460: "TTY: do not update atime/mtime on read/write"), and then
limited it to only update it occasionally (commit 4687116e2ae9: "TTY:
fix atime/mtime regression"), but it turns out that this was both
insufficient and overkill.

It was insufficient because we let people attach to the shared ptmx node
to see activity without even reading atime/mtime, and it was overkill
because the "only once a minute" means that you can't really tell an
idle person from an active one with 'w'.

So this tries to fix the problem properly.  It marks the shared ptmx
node as un-notifiable, and it lowers the "only once a minute" to a few
seconds instead - still long enough that you can't time individual
keystrokes, but short enough that you can tell whether somebody is
active or not.

Reported-by: Simon Kirby <sim@hostway.ca>
Acked-by: Jiri Slaby <jslaby@suse.cz>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/tty/pty.c
drivers/tty/tty_io.c