Messages in this thread | | | Date | Mon, 13 Mar 2000 10:13:48 +0100 | From | Manfred Spraul <> | Subject | Re: PROPOSAL: Fixing the sys5 emulation bugs in shmfs |
| |
You added a dead-lock: * shm_lock() is a spinlock. * shm_swap() is called from try_to_free_pages(), and that function could be called with the big kernel lock acquired; shm_swap() calls shm_lockall().
Alan Cox wrote: > + shp = shm_lock(shmid); ^^^^^^^^^^^^^^^ spinlock acquired.
> + if(shp==NULL) > + return -EINVAL; > + err=-EIDRM; > + if(shm_checkid(shp,shmid)) > + goto out_unlock; > + if(shp->nattch==0) > + shm_remove_name(shmid); [...] > > +static void shm_remove_name(int id) > +{ > + char *name = shm_getname(id); > + if (!IS_ERR(name)) > + { > + struct dentry *saved; > + lock_kernel(); ^^^^^^^^^^^^^^^^^^^^^^^^^^^ and lock_kernel(). > + saved=shm_push_chroot(); > + do_unlink (name);
I documented the spinlock ordering in shm.c, ~ line 190.
-- Manfred
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |