public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Rajat Jain <rajatxjain@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-newbie@vger.kernel.org, Greg Kroah-Hartman <greg@kroah.com>
Subject: Re: debugfs_remove_recursive() while a file is in use by userspace
Date: Mon, 28 Dec 2015 20:30:31 +0000	[thread overview]
Message-ID: <20151228203031.GI20997@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CAA93t1pTkDpaZpQuVu0bQpxsxxUDViKU6-bLbporqkyHCJ0=mw@mail.gmail.com>

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).
> 
> Does the function wait
> 
> (1) until all the currently executing file operation methods
> (read/write/map etc) have returned?

No

> 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)?

... and no.  Don't use debugfs for objects that might have a finite
lifetime, or you'll get trouble.  And don't use debugfs outside of
well-isolated testing systems.

  reply	other threads:[~2015-12-28 20:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-28 20:27 debugfs_remove_recursive() while a file is in use by userspace Rajat Jain
2015-12-28 20:30 ` Al Viro [this message]
2015-12-28 20:31 ` Greg Kroah-Hartman
2015-12-28 20:51   ` Rajat Jain
2015-12-28 20:58     ` Greg Kroah-Hartman
2015-12-28 21:11       ` Rajat Jain
2015-12-28 21:17         ` Greg Kroah-Hartman
2015-12-28 20:42 ` Nicolai Stange
2015-12-28 20:56   ` Rajat Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151228203031.GI20997@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-newbie@vger.kernel.org \
    --cc=rajatxjain@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox