Skip to contentSkip to conversation

nvme-fcloop: Resolve warnings on RCU usage and sleep warnings

PATCH New James Smart 3 participants 3 messages Jun 20, 2019 – Jun 28, 2019

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

PATCH 1/1 nvme-fcloop: Resolve warnings on RCU usage and sleep warnings

With additional debugging enabled, seeing warnings for suspicious RCU usage or Sleeping function called from invalid context.

These both map to allocation of a work structure which is currently GFP_KERNEL, meaning it can sleep. For the RCU warning, the sequence was sleeping while holding the RCU lock.

Convert the allocation to GFP_ATOMIC.

Signed-off-by James Smart <jsmart2021 at gmail.com>

---
repost fixing munged title

---
 drivers/nvme/target/fcloop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/fcloop.c +1 -1
index e64969d2a7c5..b50b53db3746 100644
@@ -535,7 +535,7 @@ fcloop_fcp_req(struct nvme_fc_local_port *localport,
 	if (!rport->targetport)
 		return -ECONNREFUSED;
 
-	tfcp_req = kzalloc(sizeof(*tfcp_req), GFP_KERNEL);
+	tfcp_req = kzalloc(sizeof(*tfcp_req), GFP_ATOMIC);
 	if (!tfcp_req)
 		return -ENOMEM;
 
Signature · 1 line
2.13.7
#1 lore raw

PATCH 1/1 nvme-fcloop: Resolve warnings on RCU usage and sleep warnings

It looks good to me:

Reviewed-by Minwoo Im <minwoo.im.dev at gmail.com>