lkml.org 
[lkml]   [2015]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: debugfs_remove_recursive() while a file is in use by userspace
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).

Bad things :(

> Does the function wait
>
> (1) until all the currently executing file operation methods
> (read/write/map etc) have returned?

Nope.

> OR
> (2) until the user has given up all references (descriptors) to the
> files under the directory (i.e. until release() method has been
> called)?

Nope.

There are some patches on the mailing list that I need to review that
hopefully should resolve this problem, as it's been known for a very
long time.

In short, just don't remove debugfs files unless your module is
unloading, and all should be good as modules are never auto-unloaded.
If you remove debugfs files when a device is removed, be careful.

thanks,

greg k-h


\
 
 \ /
  Last update: 2015-12-28 22:01    [W:0.044 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site