[systemd-devel] [PATCH 2/2] domain: grab the domain's parent lock only when needed

Kay Sievers kay at vrfy.org
Sat Mar 22 11:30:37 PDT 2014


On Fri, Mar 21, 2014 at 12:35 PM, Djalal Harouni <tixxdz at opendz.org> wrote:
> On Thu, Mar 20, 2014 at 10:58:21AM +0100, Daniel Mack wrote:

>> >     /* link into parent domain */
>> >     if (parent) {
>>
>> What if 'parent' was already unrefed at this point? That can happen any
>> time as soon we give up the lock.
>
> Ok yes, but in that case what about the first 'parent' check at line
> 259 ? we can also race against it? I thought that since we are at this
> point, we are sure that the parent won't be unrefed!

The caller should be the parent itself, and as long as the caller has
a file (handle.c) open, the domain of the caller should be pinned into
memory.

Kay


More information about the systemd-devel mailing list