lkml.org 
[lkml]   [2013]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -mm -next] ipc,sem: untangle RCU locking with find_alloc_undo
On 03/30/2013 09:35 AM, Sasha Levin wrote:

> I'm thinking that the solution is as simple as:

Your patch is absolutely correct. All it needs now is your
signed-off-by, so Andrew can merge it into -mm :)

Reviewed-by: Rik van Riel <riel@redhat.com>

> diff --git a/ipc/sem.c b/ipc/sem.c
> index 6e109ef..ac36671 100644
> --- a/ipc/sem.c
> +++ b/ipc/sem.c
> @@ -1333,8 +1333,10 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum,
> /* GETVAL, GETPID, GETNCTN, GETZCNT: fall-through */
> }
> err = -EINVAL;
> - if(semnum < 0 || semnum >= nsems)
> - goto out_unlock;
> + if(semnum < 0 || semnum >= nsems) {
> + rcu_read_unlock();
> + goto out_wakeup;
> + }
>
> sem_lock(sma, NULL, -1);
> curr = &sma->sem_base[semnum];
>
> But I'm not 100% sure if I don't mess up anything else.

I checked the surrounding code, it all looks fine.

--
All rights reversed.


\
 
 \ /
  Last update: 2013-03-31 04:21    [W:0.167 / U:0.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site