Re: closefd: closes a file of any process

Tigran Aivazian (tigran@veritas.com)
Tue, 27 Jun 2000 14:24:09 +0100 (BST)


On Tue, 27 Jun 2000 uaca@alumni.uv.es wrote:
> __but__ filp calls locs_wake_up_blocks __always__ with wait = 0
>
> so it seems there is no a problem here

well spotted! Ok then, I agree the Linux locks implementation is not as
broken as I thought :)

Amazing that nobody noticed this before. Ok, next problem - how do you
synchronize this non-current do_close() with the possibility of the
process being between

file = fget(fd);
...
fput(file);

? You can add a rw semaphore to struct file, being taken read inside fget
and write in (only non-current!) do_close but that means such do_close can
potentially be blocked forever (if someone is doing a read() that can
block forever, e.g. on /proc/kmsg). So, we may need interruptible
read-write semaphores?

What think ye?

Regards,
Tigran

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/