mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Race condition: calling remove_proc_entry in cleanup_module (module_exit) while someone's using procfile
@ 2007-09-04 16:39 anon... anon.al
  2007-09-04 16:45 ` anon... anon.al
  2007-09-04 16:56 ` Alexey Dobriyan
  0 siblings, 2 replies; 4+ messages in thread
From: anon... anon.al @ 2007-09-04 16:39 UTC (permalink / raw)
  To: linux-kernel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-09-04 17:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-04 16:39 Race condition: calling remove_proc_entry in cleanup_module (module_exit) while someone's using procfile anon... anon.al
2007-09-04 16:45 ` anon... anon.al
2007-09-04 16:56 ` Alexey Dobriyan
2007-09-04 17:35   ` anon... anon.al

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®