lkml.org 
[lkml]   [2013]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 4/4] ipc: sem: do not hold ipc lock more than necessary
On 03/05/2013 04:36 AM, Davidlohr Bueso wrote:

> @@ -888,27 +924,34 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum,
> {
> struct sem_array *sma;
> struct sem* curr;
> - int err;
> + int err, nsems;
> ushort fast_sem_io[SEMMSL_FAST];
> ushort* sem_io = fast_sem_io;
> - int nsems;
> struct list_head tasks;
>
> - sma = sem_lock_check(ns, semid);
> - if (IS_ERR(sma))
> + INIT_LIST_HEAD(&tasks);
> +
> + rcu_read_lock();
> + sma = sem_obtain_object_check(ns, semid);
> + if (IS_ERR(sma)) {
> + rcu_read_lock();

I assume this should be an rcu_read_unlock? :)

> return PTR_ERR(sma);
> + }


--
All rights reversed


\
 
 \ /
  Last update: 2013-03-06 00:41    [W:0.045 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site