lkml.org 
[lkml]   [2019]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] debugfs: fix potential infinite loop in debugfs_remove_recursive
On Thu, 14 Nov 2019 14:59:04 +0800
"yukuai (C)" <yukuai3@huawei.com> wrote:

> > Have you tried this patch with lockdep enabled and tried to hit this
> > code path?
> >

> >
> You are right, I get the results with lockdep enabled:

That was what I was afraid of :-(

> [ 64.314748] ============================================
> [ 64.315568] WARNING: possible recursive locking detected
> [ 64.316549] 5.4.0-rc7-dirty #5 Tainted: G O
> [ 64.317398] --------------------------------------------
> [ 64.318230] rmmod/2607 is trying to acquire lock:

>
> The warning will disappeare by adding
> lockdep_set_novalidate_class(&child->d_lock) before calling
> simple_empty(child). But I'm not sure It's the right modfication.

I'm wondering if we should add a simple_empty_unlocked() that does
simple_empty() without taking the lock, to allow us to call
spin_lock_nested() on the child. Of course, I don't know how much
nesting we allow as it calls the nesting too.

This looks to be something that the vfs folks need to look at.

-- Steve

\
 
 \ /
  Last update: 2019-11-14 15:34    [W:1.898 / U:1.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site