All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [patch -next] ocfs2: scheduling in atomic in ocfs2_filecheck_store()
Date: Mon, 27 Jul 2015 08:27:23 +0000	[thread overview]
Message-ID: <20150727082723.GA3310@mwanda> (raw)

We're hold "spin_lock(&ent->fs_fcheck->fc_lock)" so the allocation has
to be GFP_ATOMIC.

I changed the sizeof() because otherwise the line goes over the 80
character limit and also the new way is prefered kernel style.

Fixes: e467fe5da718 ('ocfs2: sysfile interfaces for online file check')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/ocfs2/filecheck.c b/fs/ocfs2/filecheck.c
index 3332af1..9613663 100644
--- a/fs/ocfs2/filecheck.c
+++ b/fs/ocfs2/filecheck.c
@@ -544,7 +544,7 @@ static ssize_t ocfs2_filecheck_store(struct kobject *kobj,
 			BUG_ON(!ocfs2_filecheck_erase_entry(ent));
 		}
 
-		entry = kmalloc(sizeof(struct ocfs2_filecheck_entry), GFP_NOFS);
+		entry = kmalloc(sizeof(*entry), GFP_ATOMIC);
 		if (entry) {
 			entry->fe_ino = args.fa_ino;
 			entry->fe_type = args.fa_type;

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [patch -next] ocfs2: scheduling in atomic in ocfs2_filecheck_store()
Date: Mon, 27 Jul 2015 11:27:23 +0300	[thread overview]
Message-ID: <20150727082723.GA3310@mwanda> (raw)

We're hold "spin_lock(&ent->fs_fcheck->fc_lock)" so the allocation has
to be GFP_ATOMIC.

I changed the sizeof() because otherwise the line goes over the 80
character limit and also the new way is prefered kernel style.

Fixes: e467fe5da718 ('ocfs2: sysfile interfaces for online file check')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/ocfs2/filecheck.c b/fs/ocfs2/filecheck.c
index 3332af1..9613663 100644
--- a/fs/ocfs2/filecheck.c
+++ b/fs/ocfs2/filecheck.c
@@ -544,7 +544,7 @@ static ssize_t ocfs2_filecheck_store(struct kobject *kobj,
 			BUG_ON(!ocfs2_filecheck_erase_entry(ent));
 		}
 
-		entry = kmalloc(sizeof(struct ocfs2_filecheck_entry), GFP_NOFS);
+		entry = kmalloc(sizeof(*entry), GFP_ATOMIC);
 		if (entry) {
 			entry->fe_ino = args.fa_ino;
 			entry->fe_type = args.fa_type;

             reply	other threads:[~2015-07-27  8:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27  8:27 Dan Carpenter [this message]
2015-07-27  8:27 ` [Ocfs2-devel] [patch -next] ocfs2: scheduling in atomic in ocfs2_filecheck_store() Dan Carpenter
2015-07-27 21:04 ` Andrew Morton
2015-07-27 21:04   ` [Ocfs2-devel] " Andrew Morton
2015-07-27 21:19   ` Dan Carpenter
2015-07-27 21:19     ` [Ocfs2-devel] " Dan Carpenter
2015-07-28  3:15   ` Gang He
2015-07-28  3:15     ` [Ocfs2-devel] " Gang He

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150727082723.GA3310@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.