mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: "Yangbin (Robin)" <robin.yb@huawei.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-fs@vger.kernel.org" <linux-fs@vger.kernel.org>
Subject: Re: A question about proc file system
Date: Wed, 28 Nov 2012 12:08:55 +0000	[thread overview]
Message-ID: <20121128120855.53181bb2@pyramind.ukuu.org.uk> (raw)
In-Reply-To: <27C64424A5A15E448C64C14B9C9BC079112E05A3@szxeml526-mbx.china.huawei.com>

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.


      reply	other threads:[~2012-11-28 12:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-28  2:55 Yangbin (Robin)
2012-11-28 12:08 ` Alan Cox [this message]

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=20121128120855.53181bb2@pyramind.ukuu.org.uk \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=linux-fs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.yb@huawei.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

all inboxes | Powered by JetHome®