On 4/30/20 4:16 AM, Linus Torvalds wrote: > On Wed, Apr 29, 2020 at 5:00 PM Jann Horn <ja...@google.com> wrote: >> >> Wouldn't you end up livelocked in the scenario that currently deadlocks? > > The test case that we already know is broken, and any fix will have to > change anyway? >
The purpose of the test case was only to test the behaviour of my later patch. The test case _must_ be adjusted to the follow-up patch, I have no problem with that. Anybody may change the test case when we know how to fix the API. I did just not anticipate that Eric would only apply 14 of 16 patches = 87.5% of the patch series. Now that causes some tension, but it is not really a problem IMHO. > Let's just say that I don't care in the least. > > But Bernd's patch as-is breaks a test-case that currently *works*, > namely something as simple as > > echo xyz > /proc/<pid>/attr/something > Excuse me, but what in my /proc folder there is no attr/something is there a procfs equivalent of pthread_attach ? What exactly is "attr/something" ? > and honestly, breaking something that _works_ and may be used in > reality, in orderf to make a known buggy user testcase work? > > Because no, "write()" returning -EAGAIN isn't ok. > write can return -EAGAIN if the file is non-blocking, it is never the case for a disk file, but for a NFS that is not at all clear, depends on a mount option, and once I had a deadlock in one of my test systems after OOM-stress, but I never was able to reproduce, the umount deadlocked, then I was not able to reboot, could be an alpha-particle of course, who knows... Hmmm.. maybe a stupid idea: We could keep the old deadlock-capable API, and add a new _flag_ somewhere to the PTHREAD_ATTACH call, that _enables_ the non-blocking behavior, how about that. Thanks Bernd. > Linus >