All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Philippe Gerum <rpm@xenomai.org>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] [Xenomai-git] Jan Kiszka : cobalt/kernel: Fix invalidation of cond shadow
Date: Fri, 15 Jan 2016 14:59:55 +0100	[thread overview]
Message-ID: <5698FB5B.3010008@siemens.com> (raw)
In-Reply-To: <56976051.2070201@xenomai.org>

On 2016-01-14 09:46, Philippe Gerum wrote:
> On 01/13/2016 08:42 PM, Jan Kiszka wrote:
>> On 2016-01-13 19:44, Philippe Gerum wrote:
>>> On 01/13/2016 07:33 PM, git repository hosting wrote:
>>>> Module: xenomai-jki
>>>> Branch: for-forge
>>>> Commit: b7d37dab571df0c0cd42aae094c3d5d1bc71db80
>>>> URL:    http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=b7d37dab571df0c0cd42aae094c3d5d1bc71db80
>>>>
>>>> Author: Jan Kiszka <jan.kiszka@siemens.com>
>>>> Date:   Wed Jan 13 19:31:23 2016 +0100
>>>>
>>>> cobalt/kernel: Fix invalidation of cond shadow
>>>>
>>>> pthread_cond_destroy fails to invalidate also the shadow object. This
>>>> can cause spurious -EBUSY errors on re-initialization of the very same
>>>> shadow as condition variable later on.
>>>>
>>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>>>
>>>> ---
>>>>
>>>>  kernel/cobalt/posix/cond.c |    2 ++
>>>>  1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/kernel/cobalt/posix/cond.c b/kernel/cobalt/posix/cond.c
>>>> index 7e115cf..84ae8fd 100644
>>>> --- a/kernel/cobalt/posix/cond.c
>>>> +++ b/kernel/cobalt/posix/cond.c
>>>> @@ -117,6 +117,8 @@ static inline int pthread_cond_destroy(struct cobalt_cond_shadow *cnd)
>>>>  
>>>>  	cobalt_cond_reclaim(&cond->resnode, s); /* drops lock */
>>>>  
>>>> +	cobalt_mark_deleted(cnd);
>>>> +
>>>>  	return 0;
>>>>  }
>>>>  
>>>>
>>>
>>> cobalt_cond_reclaim() invalidates the shadow object already. Did you
>>
>> Nope, it only invalidates cond->magic, i.e. the object itself. We also
>> need to invalidate cnd->magic here. See also mutex.c, it has the same
>> pattern.
>>
> 
> Ack, I misread the patch. This is a regression compared to 2.x, we need
> both descriptors to be invalidated indeed.
> 

OK, will you pull into into next and stable? BTW, it's now successfully
validated by our test scenario.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux


  reply	other threads:[~2016-01-15 13:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1aJQEe-0006t5-UO@sd-51317.xenomai.org>
2016-01-13 18:44 ` [Xenomai] [Xenomai-git] Jan Kiszka : cobalt/kernel: Fix invalidation of cond shadow Philippe Gerum
2016-01-13 19:42   ` Jan Kiszka
2016-01-14  8:46     ` Philippe Gerum
2016-01-15 13:59       ` Jan Kiszka [this message]
2016-01-16 17:00         ` Philippe Gerum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5698FB5B.3010008@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=rpm@xenomai.org \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.