LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* fs/ocfs2/dlm: Use GFP_ATOMIC under spin_lock
@ 2010-11-02 22:36 David Sterba
  2010-11-18 23:42 ` Joel Becker
  2011-01-28  1:09 ` Andrew Morton
  0 siblings, 2 replies; 8+ messages in thread
From: David Sterba @ 2010-11-02 22:36 UTC (permalink / raw)
  To: ocfs2-devel; +Cc: linux-kernel, mfasheh, joel.becker

coccinelle check scripts/coccinelle/locks/call_kern.cocci found that
in fs/ocfs2/dlm/dlmdomain.c an allocation with GFP_KERNEL is done
with locks held:

dlm_query_region_handler
  spin_lock(dlm_domain_lock)
    dlm_match_regions
      kmalloc(GFP_KERNEL)

Change it to GFP_ATOMIC.

Signed-off-by: David Sterba <dsterba@suse.cz>
CC: Joel Becker <joel.becker@oracle.com>
CC: Mark Fasheh <mfasheh@suse.com>
CC: ocfs2-devel@oss.oracle.com

--
Exists in v2.6.37-rc1 and current linux-next.

diff -u -p a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c
--- a/fs/ocfs2/dlm/dlmdomain.c 2010-10-22 10:23:23.502434402 +0200
+++ b/fs/ocfs2/dlm/dlmdomain.c 2010-11-02 17:11:06.000000000 +0100
@@ -959,7 +959,7 @@ static int dlm_match_regions(struct dlm_
                r += O2HB_MAX_REGION_NAME_LEN;
        }

-       local = kmalloc(sizeof(qr->qr_regions), GFP_KERNEL);
+       local = kmalloc(sizeof(qr->qr_regions), GFP_ATOMIC);
        if (!local) {
                status = -ENOMEM;
                goto bail;


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-01-28  2:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-02 22:36 fs/ocfs2/dlm: Use GFP_ATOMIC under spin_lock David Sterba
2010-11-18 23:42 ` Joel Becker
2011-01-28  1:09 ` Andrew Morton
2011-01-28  1:28   ` [Ocfs2-devel] " Sunil Mushran
2011-01-28  1:48     ` Andrew Morton
2011-01-28  1:35   ` Joel Becker
2011-01-28  1:48     ` Andrew Morton
2011-01-28  2:33       ` Joel Becker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).