* debugfs oddity
@ 2006-10-02 9:25 Johannes Berg
2006-10-03 5:28 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2006-10-02 9:25 UTC (permalink / raw)
To: Greg KH, Takashi Iwai, linux-kernel, Joel Becker, Michael Buesch
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.
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.
johannes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: debugfs oddity
2006-10-02 9:25 debugfs oddity Johannes Berg
@ 2006-10-03 5:28 ` Greg KH
2006-10-04 7:20 ` Johannes Berg
0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2006-10-03 5:28 UTC (permalink / raw)
To: Johannes Berg; +Cc: Takashi Iwai, linux-kernel, Joel Becker, Michael Buesch
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: debugfs oddity
2006-10-03 5:28 ` Greg KH
@ 2006-10-04 7:20 ` Johannes Berg
2006-10-04 8:12 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2006-10-04 7:20 UTC (permalink / raw)
To: Greg KH; +Cc: Takashi Iwai, linux-kernel, Joel Becker, Michael Buesch
On Mon, 2006-10-02 at 22:28 -0700, Greg KH wrote:
> 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?
Just had a go -- ramfs works as expected, at least when I do the dance
from userspace as I had in (a')-(d').
johannes
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: debugfs oddity
2006-10-04 7:20 ` Johannes Berg
@ 2006-10-04 8:12 ` Greg KH
2006-10-04 8:23 ` Johannes Berg
0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2006-10-04 8:12 UTC (permalink / raw)
To: Johannes Berg; +Cc: Takashi Iwai, linux-kernel, Joel Becker, Michael Buesch
On Wed, Oct 04, 2006 at 09:20:46AM +0200, Johannes Berg wrote:
> On Mon, 2006-10-02 at 22:28 -0700, Greg KH wrote:
>
> > 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?
>
> Just had a go -- ramfs works as expected, at least when I do the dance
> from userspace as I had in (a')-(d').
I don't understand. Does ramfs have the same issues you feel debugfs
has? Or does it work like a disk based file system?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-10-04 8:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-02 9:25 debugfs oddity Johannes Berg
2006-10-03 5:28 ` Greg KH
2006-10-04 7:20 ` Johannes Berg
2006-10-04 8:12 ` Greg KH
2006-10-04 8:23 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox