Skip to contentSkip to conversation

ocfs2/dlm: use GFP_ATOMIC inside a spin_lock

PATCH In review Dan Carpenter 4 participants 4 messages Jul 26, 2012 – Aug 15, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocfs2/dlm: use GFP_ATOMIC inside a spin_lock

My static checker complains that this is called with a spin_lock held in dlm_master_requery_handler() from dlmrecovery.c. Probably the reason we have not received any bug reports about this is that recovery is not a common operation.

fs/ocfs2/dlm/dlmmaster.c +1 -1
index 005261c..33ecbe0 100644
@@ -2020,7 +2020,7 @@ int dlm_dispatch_assert_master(struct dlm_ctxt *dlm,
 			       int ignore_higher, u8 request_from, u32 flags)
 {
 	struct dlm_work_item *item;
-	item = kzalloc(sizeof(*item), GFP_NOFS);
+	item = kzalloc(sizeof(*item), GFP_ATOMIC);
 	if (!item)
 		return -ENOMEM;
 
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Dan Carpenter

My static checker complains that this is called with a spin_lock held in dlm_master_requery_handler() from dlmrecovery.c. Probably the reason we have not received any bug reports about this is that recovery is not a common operation.

Looks reasonable to me. Sunil, we might just want to have that dlm_work_item allocated by the caller, yes?

	--Mark

--
Mark Fasheh

#2 lore raw

PATCH 1/1 ocfs2/dlm: use GFP_ATOMIC inside a spin_lock

Quoted 10 lines · Mark Fasheh
Quoted 4 lines · Dan Carpenter

My static checker complains that this is called with a spin_lock held in dlm_master_requery_handler() from dlmrecovery.c. Probably the reason we have not received any bug reports about this is that recovery is not a common operation.

Looks reasonable to me. Sunil, we might just want to have that dlm_work_item
allocated by the caller, yes?

My static checker complains that this is called with a spin_lock held in dlm_master_requery_handler() from dlmrecovery.c. Probably the reason we have not received any bug reports about this is that recovery is not a common operation.

fs/ocfs2/dlm/dlmmaster.c +1 -1
index 005261c..33ecbe0 100644
@@ -2020,7 +2020,7 @@ int dlm_dispatch_assert_master(struct dlm_ctxt *dlm,
 			       int ignore_higher, u8 request_from, u32 flags)
 {
 	struct dlm_work_item *item;
-	item = kzalloc(sizeof(*item), GFP_NOFS);
+	item = kzalloc(sizeof(*item), GFP_ATOMIC);
 	if (!item)
 		return -ENOMEM;
 

--

I don't think the caller needs to hold the lockres spinlock. But this will do too.

Yes, this is rare because this gets triggered only if a node that is migrating
ownership (to or from) dies before migration completes. This part of the code
is any case shaky as best as it is hard to test all cases.

Sunil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20120730/26e1b515/attachment.html

maintainer
#3 lore raw
In reply to Dan Carpenter
Quoted 6 lines · Dan Carpenter

My static checker complains that this is called with a spin_lock held in dlm_master_requery_handler() from dlmrecovery.c. Probably the reason we have not received any bug reports about this is that recovery is not a common operation.

This patch is now part of the fixes branch of ocfs2.git.

Joel

Quoted 14 lines
fs/ocfs2/dlm/dlmmaster.c +1 -1
index 005261c..33ecbe0 100644
@@ -2020,7 +2020,7 @@ int dlm_dispatch_assert_master(struct dlm_ctxt *dlm,
 			       int ignore_higher, u8 request_from, u32 flags)
 {
 	struct dlm_work_item *item;
-	item = kzalloc(sizeof(*item), GFP_NOFS);
+	item = kzalloc(sizeof(*item), GFP_ATOMIC);
 	if (!item)
 		return -ENOMEM;
 
Signature · 7 lines
"We will have to repent in this generation not merely for the
 vitriolic words and actions of the bad people, but for the 
 appalling silence of the good people."
	- Rev. Dr. Martin Luther King, Jr.

			http://www.jlbec.org/
			[email protected]