Re: [PATCH][2.1.71] BSD revoke() syscall

Alan Cox (alan@lxorguk.ukuu.org.uk)
Tue, 9 Dec 1997 09:05:44 +0000 (GMT)


> The enclosed patch implements most of the BSD revoke() syscall,
> although it probably needs an fs bod to add a few extra locks
> of something...

Without lack of respect for the effort "urggggggggggggggggghhhhhhhh" 8)

Have a look how the tty layer revokes access to things. Instead of putting
another check inline with every fs syscall it changes the read/write/etc
methods for the object to point to ones that return -ENXIO. That then
requires no extra changes although it does have some implicit races - as
does yours. Specifically

begin read
revoke
read wakes up
complete read

next read
-EIO
next read
-EIO

the tty drivers handle the relevant races correctly internally if I am
reading the code right.