Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752639Ab3FJQOv (ORCPT ); Mon, 10 Jun 2013 12:14:51 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:29301 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751030Ab3FJQOu (ORCPT ); Mon, 10 Jun 2013 12:14:50 -0400 From: Sasha Levin To: akpm@linux-foundation.org Cc: davidlohr.bueso@hp.com, riel@redhat.com, walken@google.com, linux-kernel@vger.kernel.org, Sasha Levin Subject: [PATCH] ipc: don't allocate with GFP_KERNEL inside rcu read lock Date: Mon, 10 Jun 2013 12:14:30 -0400 Message-Id: <1370880870-23833-1-git-send-email-sasha.levin@oracle.com> X-Mailer: git-send-email 1.8.1.2 X-Source-IP: ucsinet22.oracle.com [156.151.31.94] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1038 Lines: 34 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/