* A question about proc file system
@ 2012-11-28 2:55 Yangbin (Robin)
2012-11-28 12:08 ` Alan Cox
0 siblings, 1 reply; 2+ messages in thread
From: Yangbin (Robin) @ 2012-11-28 2:55 UTC (permalink / raw)
To: linux-kernel, linux-fs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 729 bytes --]
Hi all:
I write a kernel module which make a dir and create a file in proc file system.
I use proc_mkdir() and create_proc_entry() in init and use remove_proc_entry() in exit.
Now I got a problem during my test:
1. open terminal A, insmod and cd into the dir the module created in proc
2. open terminal B. rmmod and insmod angain.
Then I cannot see the file which should be created by the module, unless terminal A quit the dir.
This will be ok with regale file system like ext3, one teminal's operation will not affert others.
Is this a bug or not?
Regards
Robin
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: A question about proc file system
2012-11-28 2:55 A question about proc file system Yangbin (Robin)
@ 2012-11-28 12:08 ` Alan Cox
0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2012-11-28 12:08 UTC (permalink / raw)
To: Yangbin (Robin); +Cc: linux-kernel, linux-fs
On Wed, 28 Nov 2012 02:55:30 +0000
"Yangbin (Robin)" <robin.yb@huawei.com> wrote:
> Hi all:
>
> I write a kernel module which make a dir and create a file in proc file system.
> I use proc_mkdir() and create_proc_entry() in init and use remove_proc_entry() in exit.
> Now I got a problem during my test:
> 1. open terminal A, insmod and cd into the dir the module created in proc
> 2. open terminal B. rmmod and insmod angain.
> Then I cannot see the file which should be created by the module, unless terminal A quit the dir.
>
> This will be ok with regale file system like ext3, one teminal's operation will not affert others.
> Is this a bug or not?
It's not. You are doing the same as this
mkdir /tmp/example
cd /tmp/example
rmdir /tmp/example
mkdir /tmp/example
in Unix like systems the file handles and current directory references
apply to the object itself not to the path.
When yo reload the driver you create a new and different directory that
has the same name but is not the same thing.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-28 12:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-28 2:55 A question about proc file system Yangbin (Robin)
2012-11-28 12:08 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®