Re: [PATCH 1/5] ipc,shm: move BUG_ON check into shm_lock

2015-06-09 Thread Davidlohr Bueso
On Tue, 2015-06-09 at 15:28 -0700, Andrew Morton wrote: > --- a/ipc/shm.c~ipcshm-move-bug_on-check-into-shm_lock-fix > +++ a/ipc/shm.c > @@ -155,14 +155,11 @@ static inline struct shmid_kernel *shm_l > { > struct kern_ipc_perm *ipcp = ipc_lock(&shm_ids(ns), id); > > - if (IS_ERR(ipcp))

Re: [PATCH 1/5] ipc,shm: move BUG_ON check into shm_lock

2015-06-09 Thread Andrew Morton
On Sat, 6 Jun 2015 06:37:56 -0700 Davidlohr Bueso wrote: > Upon every shm_lock call, we BUG_ON if an error was returned, > indicating racing either in idr or in shm_destroy. Move this logic > into the locking. > > --- a/ipc/shm.c > +++ b/ipc/shm.c > @@ -155,8 +155,14 @@ static inline struct shm

[PATCH 1/5] ipc,shm: move BUG_ON check into shm_lock

2015-06-06 Thread Davidlohr Bueso
Upon every shm_lock call, we BUG_ON if an error was returned, indicating racing either in idr or in shm_destroy. Move this logic into the locking. Signed-off-by: Davidlohr Bueso --- ipc/shm.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ipc/shm.c b/ipc/shm.c in