lkml.org 
[lkml]   [2013]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ipc: don't allocate with GFP_KERNEL inside rcu read lock
Date
ipc_addid() is protected by a rcu read lock, which means we can't allocate
using GFP_KERNEL inside it.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---

Another option would be to call idr_preload from outside the read lock,
but that complicates the code much more than this fix. If that's the
preferred method to fix it I can resend that solution instead.

ipc/util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipc/util.c b/ipc/util.c
index a746abb..00aca85 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -261,7 +261,7 @@ int ipc_addid(struct ipc_ids* ids, struct kern_ipc_perm* new, int size)
if (ids->in_use >= size)
return -ENOSPC;

- idr_preload(GFP_KERNEL);
+ idr_preload(GFP_ATOMIC);

spin_lock_init(&new->lock);
new->deleted = 0;
--
1.8.1.2


\
 
 \ /
  Last update: 2013-06-10 19:01    [W:0.039 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site