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/