Re: [PATCH RFC 1/1] kernfs: keep kernfs node alive for __kernfs_remove()

2019-04-17 Thread Tejun Heo
Hello, On Wed, Apr 17, 2019 at 04:12:29PM +, Konstantin Khorenko wrote: > i don't know the full scenario unfortunately, but the idea is the following: > > __kernfs_remove() is called under kernfs_mutex and if >!(!kn || (kn->parent && RB_EMPTY_NODE(&kn->rb))) > > it assumes that nothing c

Re: [PATCH RFC 1/1] kernfs: keep kernfs node alive for __kernfs_remove()

2019-04-17 Thread Konstantin Khorenko
On 04/16/2019 10:17 PM, Tejun Heo wrote: > On Tue, Apr 16, 2019 at 06:53:35PM +0300, Konstantin Khorenko wrote: >> __kernfs_remove() which is called under kernfs_mutex, >> assumes nobody kills kernfs node whie it's working on it >> and "get"s current kernfs node for that. >> >> But we hit a warning

Re: [PATCH RFC 1/1] kernfs: keep kernfs node alive for __kernfs_remove()

2019-04-16 Thread Tejun Heo
On Tue, Apr 16, 2019 at 06:53:35PM +0300, Konstantin Khorenko wrote: > __kernfs_remove() which is called under kernfs_mutex, > assumes nobody kills kernfs node whie it's working on it > and "get"s current kernfs node for that. > > But we hit a warning in kernfs_get(): kn->counter == 0 already: >

[PATCH RFC 1/1] kernfs: keep kernfs node alive for __kernfs_remove()

2019-04-16 Thread Konstantin Khorenko
__kernfs_remove() which is called under kernfs_mutex, assumes nobody kills kernfs node whie it's working on it and "get"s current kernfs node for that. But we hit a warning in kernfs_get(): kn->counter == 0 already: [ cut here ] WARNING: CPU: 2 PID: 63923 at fs/kernfs/d