mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "anon... anon.al" <anon.asdf@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Race condition: calling remove_proc_entry in cleanup_module (module_exit) while someone's using procfile
Date: Tue, 4 Sep 2007 18:39:33 +0200	[thread overview]
Message-ID: <379fb4870709040939m2430be6ci57fd73f1f9abc6ef@mail.gmail.com> (raw)

Hi!

There is a race condition if an instance is executing "__exit
device_exit" and calls remove_proc_entry, while someone is still using
the procfile, right?.

static void __exit device_exit(void)
{
  // what if the procfile is still in use?
  remove_proc_entry(PROC_FILE_NAME, &proc_root);
}

To remove this race condition, the code in "__exit device_exit" must
a) be sure that no other instance is in procfile functions
b) call remove_proc_entry before any other instance accesses the procfile

*** Is this at all possible if a race-condition is to be avoided?
If yes: which mechanism can be used?

Thanks -Albert

             reply	other threads:[~2007-09-04 16:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-04 16:39 anon... anon.al [this message]
2007-09-04 16:45 ` anon... anon.al
2007-09-04 16:56 ` Alexey Dobriyan
2007-09-04 17:35   ` anon... anon.al

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=379fb4870709040939m2430be6ci57fd73f1f9abc6ef@mail.gmail.com \
    --to=anon.asdf@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®