lkml.org 
[lkml]   [2018]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: INFO: task hung in lo_ioctl
From
Date
Peter Zijlstra wrote:
> On Fri, Apr 06, 2018 at 09:04:18PM +0900, Tetsuo Handa wrote:
> > + /* Temporary hack for handling lock imbalance. */
> > + if (__mutex_owner(&lo->lo_ctl_mutex) == current)
> > + mutex_unlock(&lo->lo_ctl_mutex);
>
> ARGGH.. you didn't read the comment we put on that?
>

Commit 5b52330bbfe63b33 ("audit: fix auditd/kernel connection state tracking")
is using __mutex_owner(). ;-)

Of course, regarding loop module, we will be able to add a flag variable
associated with lo->lo_ctl_mutex. But that will be done after we solved
the deadlock problem. I think whether we need to drop lo->lo_ctl_mutex is
not clear. Maybe

- err = mutex_lock_killable_nested(&lo->lo_ctl_mutex, 1);
+ err = mutex_lock_killable(&lo->lo_ctl_mutex);

on top of this patch and listen to the lockdep?

Commit f028f3b2f987ebc6 ("loop: fix circular locking in loop_clr_fd()") says

A simple way to silence lockdep could be to mark the lo_ctl_mutex
in ioctl to be a sub class, but this might mask some other real bugs.

and we are currently hitting a deadlock problem.

\
 
 \ /
  Last update: 2018-04-06 15:57    [W:0.086 / U:0.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site