Am Samstag, den 30.05.2020, 13:58 +0900 schrieb Tetsuo Handa: Hi, sorry for taking this long. There has been a family emergency. > > The kernel most definitely does need to protect itself against > > misbehaving hardware. Let's just leave it at that. If you don't > > believe me, ask Greg KH. > > I've made many locations killable (in order to reduce damage caused by OOM > condition). But I can't make locations killable where handling SIGKILL case is > too difficult to implement. We can make flush interruptible. But that will not do the job. We would get a file that cannot be closed. > "struct file_operations"->flush() is called from filp_close() when there is > something which has to be done before "struct file_operations"->release() is > called. Yes, in particular error reporting. Without flush() there is no way to know whether the last write() has actually worked. > As far as I read this thread, what you are trying to do sounds like allow > "not waiting for completion of wdm_out_callback()" with only > 's/wait_event/wait_event_intrruptible/' in wdm_flush(). Then, please do remove > wdm_flush() call itself. That would break error reporting. That flush() waits for IO to complete is basically a side effect. You can know whether IO has worked after it is finished. > Therefore, again, please show me as a patch first. Sure, attached. The difficulty here is that I see three possible interacting errors, two of which are races. Regards Oliver