Sahan Fernando
d0f314b23c
Kernel: Fix subtle race condition in sys$write implementation
...
There is a slight race condition in our implementation of write().
We call File::can_write() before attempting to write to it (blocking if
it returns false). If it returns true, we assume that we can write to
the file, and our code assumes that File::write() cannot possibly fail
by being blocked. There is, however, the rare case where another process
writes to the file and prevents further writes in between the call to
Files::can_write() and File::write() in the first process. This would
result in the first process calling File::write() when it cannot be
written to.
We fix this by adding a mechanism for File::can_write() to signal that
it was blocked, making it the responsibilty of File::write() to check
whether it can write and then finally making sys$write() check if the
write failed due to it being blocked.
2021-05-18 16:33:15 +02:00
..
2021-05-08 19:15:54 +02:00
2021-05-17 13:32:19 +02:00
2021-05-16 19:58:33 +02:00
2021-05-18 16:33:15 +02:00
2021-05-16 19:58:33 +02:00
2021-05-17 17:48:55 +01:00
2021-05-18 08:10:45 +02:00
2021-05-05 18:48:26 +02:00
2021-04-22 11:22:27 +02:00
2021-05-18 16:06:27 +02:00
2021-05-17 19:45:35 +01:00
2021-05-16 19:58:33 +02:00
2021-05-18 16:33:15 +02:00
2021-04-22 11:22:27 +02:00
2021-05-17 21:53:04 +02:00
2021-05-17 18:19:49 +02:00
2021-05-15 23:29:03 +01:00
2021-05-16 19:58:33 +02:00
2021-04-22 21:15:54 +02:00
2021-04-22 21:15:54 +02:00
2021-04-22 11:22:27 +02:00
2021-05-17 19:30:12 +02:00
2021-04-22 11:22:27 +02:00
2021-04-22 11:22:27 +02:00
2021-05-16 19:58:33 +02:00
2021-05-16 19:58:33 +02:00
2021-05-16 19:58:33 +02:00
2021-05-16 19:58:33 +02:00
2021-04-22 22:51:19 +02:00
2021-04-22 11:22:27 +02:00
2021-05-16 19:58:33 +02:00
2021-04-22 11:22:27 +02:00
2021-04-22 11:22:27 +02:00
2021-04-29 08:09:53 +02:00
2021-04-29 08:09:53 +02:00
2021-04-22 11:22:27 +02:00
2021-04-29 00:59:26 +02:00
2021-04-29 00:59:26 +02:00
2021-05-17 18:15:25 +02:00
2021-04-22 11:22:27 +02:00
2021-05-13 16:21:53 +02:00
2021-05-13 16:21:53 +02:00
2021-05-13 08:27:42 +02:00
2021-05-17 18:15:25 +02:00
2021-04-22 11:22:27 +02:00
2021-05-16 19:58:33 +02:00
2021-04-28 22:14:32 +02:00
2021-04-22 11:22:27 +02:00
2021-03-04 18:25:01 +01:00
2021-04-25 09:38:27 +02:00
2021-04-25 09:38:27 +02:00
2021-04-29 00:59:26 +02:00
2021-04-22 11:22:27 +02:00
2021-04-22 11:22:27 +02:00
2021-05-16 19:58:33 +02:00
2021-05-16 19:58:33 +02:00
2021-05-16 10:36:52 +01:00
2021-05-14 00:35:57 +02:00
2021-05-14 00:35:57 +02:00
2021-04-22 11:22:27 +02:00
2021-05-17 21:53:04 +02:00
2021-05-17 13:32:19 +02:00
2021-04-23 16:46:57 +02:00
2021-04-22 11:22:27 +02:00
2021-04-25 09:38:27 +02:00
2021-04-22 11:22:27 +02:00
2021-04-22 11:22:27 +02:00
2021-04-22 11:22:27 +02:00
2021-05-16 19:58:33 +02:00
2021-04-22 11:22:27 +02:00
2021-04-22 11:22:27 +02:00
2021-04-29 20:26:36 +02:00
2021-04-22 11:22:27 +02:00
2021-04-29 20:26:36 +02:00
2021-05-16 10:36:52 +01:00
2021-05-16 10:36:52 +01:00
2021-05-05 18:51:06 +02:00
2021-04-22 11:22:27 +02:00
2021-05-13 16:21:53 +02:00
2021-05-05 18:51:06 +02:00
2021-04-22 11:22:27 +02:00
2021-05-15 09:00:29 +02:00
2021-04-22 11:22:27 +02:00
2021-05-14 23:32:10 +02:00
2021-04-22 11:22:27 +02:00
2021-04-22 11:22:27 +02:00
2021-05-13 23:28:40 +02:00
2021-04-22 11:22:27 +02:00
2021-04-29 00:59:26 +02:00
2021-04-29 00:59:26 +02:00
2021-04-29 00:59:26 +02:00
2021-04-29 00:59:26 +02:00