Re: debugfs_remove_recursive() while a file is in use by userspace

2015-12-28 Thread Greg Kroah-Hartman
On Mon, Dec 28, 2015 at 01:11:53PM -0800, Rajat Jain wrote: > On Mon, Dec 28, 2015 at 12:58 PM, Greg Kroah-Hartman wrote: > > On Mon, Dec 28, 2015 at 12:51:32PM -0800, Rajat Jain wrote: > >> Thanks Greg and Al for the quick turnaround. > >> > >> Essentially I have a device that supports something

Re: debugfs_remove_recursive() while a file is in use by userspace

2015-12-28 Thread Rajat Jain
On Mon, Dec 28, 2015 at 12:58 PM, Greg Kroah-Hartman wrote: > On Mon, Dec 28, 2015 at 12:51:32PM -0800, Rajat Jain wrote: >> Thanks Greg and Al for the quick turnaround. >> >> Essentially I have a device that supports something called "contexts" >> that can be "created" and "destroyed" during the

Re: debugfs_remove_recursive() while a file is in use by userspace

2015-12-28 Thread Greg Kroah-Hartman
On Mon, Dec 28, 2015 at 12:51:32PM -0800, Rajat Jain wrote: > Thanks Greg and Al for the quick turnaround. > > Essentially I have a device that supports something called "contexts" > that can be "created" and "destroyed" during the life of the device. I > want to expose some debug files for the co

Re: debugfs_remove_recursive() while a file is in use by userspace

2015-12-28 Thread Rajat Jain
> > The current state is that both question are to be answered with "no", > i.e. debugfs file removal is racy. > Ouch! :-(. Thanks for confirming! Somewhat related, is my understanding correct that the behaviour of character device layer w.r.t. the two questions that I asked the answer to my ques

Re: debugfs_remove_recursive() while a file is in use by userspace

2015-12-28 Thread Rajat Jain
Thanks Greg and Al for the quick turnaround. Essentially I have a device that supports something called "contexts" that can be "created" and "destroyed" during the life of the device. I want to expose some debug files for the context when it is created, and destroy the files when the context is de

Re: debugfs_remove_recursive() while a file is in use by userspace

2015-12-28 Thread Nicolai Stange
Hi Rajat, Rajat Jain writes: > Hi, > > I wanted to understand the behavior taken when a module calls > debugfs_remove_recursive() on a directory, while files under that > directory may still be in use by the userspace (for instance an > ongoing read / write operation). > > Does the function wait

Re: debugfs_remove_recursive() while a file is in use by userspace

2015-12-28 Thread Greg Kroah-Hartman
On Mon, Dec 28, 2015 at 12:27:22PM -0800, Rajat Jain wrote: > Hi, > > I wanted to understand the behavior taken when a module calls > debugfs_remove_recursive() on a directory, while files under that > directory may still be in use by the userspace (for instance an > ongoing read / write operation

Re: debugfs_remove_recursive() while a file is in use by userspace

2015-12-28 Thread Al Viro
On Mon, Dec 28, 2015 at 12:27:22PM -0800, Rajat Jain wrote: > Hi, > > I wanted to understand the behavior taken when a module calls > debugfs_remove_recursive() on a directory, while files under that > directory may still be in use by the userspace (for instance an > ongoing read / write operation

debugfs_remove_recursive() while a file is in use by userspace

2015-12-28 Thread Rajat Jain
Hi, I wanted to understand the behavior taken when a module calls debugfs_remove_recursive() on a directory, while files under that directory may still be in use by the userspace (for instance an ongoing read / write operation). Does the function wait (1) until all the currently executing file o