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

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to