Re: [PATCH 2/3] fd/locks: allow get the lock owner by F_OFD_GETLK
From: stsp
Date: Tue Jun 20 2023 - 07:45:35 EST
20.06.2023 16:12, Jeff Layton пишет:
Multithreaded processes are also a bit of a gray area here: Suppose I
open a file and set an OFD lock on it in one task, and then let that
task exit while the file is still open. What should l_pid say in that
case?
If by the "task" you mean a process, then
the result should be no lock at all.
If you mean the thread exit, then I would
expect l_pid to contain tgid, in which case
it will still point to the valid pid.
Or do you mean l_pid contains tid?
Checking... no, l_pid contains tgid.
So I don't really see the problem you are
pointing with the above example, could
you please clarify?