public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Takashi Iwai <tiwai@suse.de>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Joel Becker <Joel.Becker@oracle.com>,
	Michael Buesch <mb@bu3sch.de>
Subject: Re: debugfs oddity
Date: Mon, 2 Oct 2006 22:28:39 -0700	[thread overview]
Message-ID: <20061003052839.GA18989@suse.de> (raw)
In-Reply-To: <1159781104.2655.47.camel@ux156>

On Mon, Oct 02, 2006 at 11:25:04AM +0200, Johannes Berg wrote:
> Recently, I observed (in bcm43xx) that debugfs seems to keep things
> alive when userspace still has a directory open. Consider the following
> sequence of events:
>  (a) kernel code creates a directory in debugfs
>  (b) user changes current directory to that
>  (c) kernel code removes that directory in debugfs
> 
> Now, consider the equivalent sequence in a regular filesystem (or
> tmpfs):
>  (a') user creates directory
>  (b') user cd's into it
>  (c') user deletes directory from a different shell
> 
> The same thing should happen, in both cases the directory is kept around
> in a way until the process that has the current dir in the dead
> directory gives it up.
> 
> Now, however, consider
>  (d') user creates directory with the same name
> 
> This works fine, and the old process sees nothing that happens in the
> new directory, as expected. However,
>  (d) kernel code tries to create a debugfs directory with the same name
> 
> does not work at all.

True, that is because the kernel thinks there is still an active dentry
with that name present in the system.

> Is this expected behaviour? It seems that once a driver requested that a
> directory is removed it can rightfully expect to be able to recreate it
> afterwards even if there's still the need to keep it lingering around
> for a bit.
> 
> Similar things can probably happen when attributes are kept open, but I
> haven't tested this. I have also not tested sysfs or configfs.

sysfs works much differently here, as does configfs.  debugfs just uses
the vfs layer's ramfs stack, so any potential problem here is probably
also present in ramfs.  Have you tried that out?

thanks,

greg k-h

  reply	other threads:[~2006-10-03  5:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-02  9:25 debugfs oddity Johannes Berg
2006-10-03  5:28 ` Greg KH [this message]
2006-10-04  7:20   ` Johannes Berg
2006-10-04  8:12     ` Greg KH
2006-10-04  8:23       ` Johannes Berg

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=20061003052839.GA18989@suse.de \
    --to=gregkh@suse.de \
    --cc=Joel.Becker@oracle.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mb@bu3sch.de \
    --cc=tiwai@suse.de \
    /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