Re: Race condition: calling remove_proc_entry in cleanup_module (module_exit) while someone's using procfile

2007-09-04 Thread anon... anon.al
On 9/4/07, Alexey Dobriyan <[EMAIL PROTECTED]> wrote: > For regular proc files, this is fixed in 2.6.23-rc1 and later. Thanks! I see you've been working on it: fix-rmmod-read-write-races-in-proc-entries... http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.22-rc6/2.6.22-rc6-mm1/br

Re: Race condition: calling remove_proc_entry in cleanup_module (module_exit) while someone's using procfile

2007-09-04 Thread anon... anon.al
On 9/4/07, anon... anon.al <[EMAIL PROTECTED]> wrote: > If yes: which mechanism can be used? I was thinking about using an atomic counter in procfile_write proc_f = create_proc_entry(PROC_FILE_NAME, 0644, NULL); //... proc_f->write_proc = procfile_write; int procfile_write

Race condition: calling remove_proc_entry in cleanup_module (module_exit) while someone's using procfile

2007-09-04 Thread anon... anon.al
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 r

memory barrier to ensure copy_to_user() completes

2007-08-31 Thread anon... anon.al
Hi! a) Which memory barrier do I require if I need to ensure that a copy_to_user(dest, src, len) completes before the next statement? copy_to_user(dest, src, len) ; //rmb(); OR wmb(); OR barrier(); OR mb(); ?? //next statement; I'm guessing: Use rmb() to be sure that all of src is in registe

Re: Nonblocking call may block in a mutex? Nonblocking call after poll may fail?

2007-08-31 Thread anon... anon.al
On Aug 31, 2:20 pm, "anon... anon.al" <[EMAIL PROTECTED]> wrote: > Setup: > there is a single output-buffer (in kernel-space) of 24 bytes for > writes from all processes A, B, and C: each process is restricted to > use at most 8 bytes: 8*3 = 24 > (until that dat

Nonblocking call may block in a mutex? Nonblocking call after poll may fail?

2007-08-31 Thread anon... anon.al
Hi! This is a driver-related question on non-blocking writes and poll. Setup: there is a single output-buffer (in kernel-space) of 24 bytes for writes from all processes A, B, and C: each process is restricted to use at most 8 bytes: 8*3 = 24 (until that data is handled (interrupt-handler...)) Q