I agree about the locking issue (although I do _not_ believe that the
tasklock should have anything to do with the tsk->tty locking - it should
most likely use some per-task lock for the actual tty accesses, together
with the optimization that a write lock on the tasklock is sufficient to
protect it because it means that nobody else can look up the task).
However, what I worry about is that there may not (will not) be a 1:1
session<->tty thing. In particular, when somebody creates a new session
with "setsid()", that does not remove the tty from processes that used to
hold it, I think (this is all from memory, so I might be wrong).
Which means that if the tty is going away, it has to be removed from _all_
tasks, not just from the one session that happened to be the most recent
one.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/