All of lore.kernel.org
 help / color / mirror / Atom feed
* owner not checked in mutex_unlock
@ 2016-03-10  9:29 Chetan Nanda
  2016-03-15 13:48 ` Cihangir Akturk
  0 siblings, 1 reply; 4+ messages in thread
From: Chetan Nanda @ 2016-03-10  9:29 UTC (permalink / raw)
  To: kernelnewbies

Hi,

As per book (Linux kernel development)

"Whoever locked a mutex must unlock it.That is, you cannot lock a mutex in one
context and then unlock it in another
"
but 'mutex_unlock' code is not checking the owner field at all.

Also, I tried with locking the mutex from normal process context and
unlocking from separate context (work context) and it is allowed
without any error from kernel.

Is it the mutex user responsibility to keep track of it? Ideally
mutex_unlock should check if owner is same as current?

Thanks,
Chetan Nanda

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-15 14:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-10  9:29 owner not checked in mutex_unlock Chetan Nanda
2016-03-15 13:48 ` Cihangir Akturk
2016-03-15 13:59   ` Chetan Nanda
2016-03-15 14:42     ` Cihangir Akturk

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.