net/smc: use GFP_ATOMIC allocation in smc_pnet_add_eth()
PATCH 1/1 net/smc: use GFP_ATOMIC allocation in smc_pnet_add_eth()
From: Eric Dumazet <[email protected]>
My last patch moved the netdev_tracker_alloc() call to a section protected by a write_lock().
I should have replaced GFP_KERNEL with GFP_ATOMIC to avoid the infamous:
BUG: sleeping function called from invalid context at include/linux/sched/mm.h:256
Fixes 28f922213886 ("net/smc: fix ref_tracker issue in smc_pnet_add()")
Signed-off-by Eric Dumazet <[email protected]>
--- net/smc/smc_pnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/smc/smc_pnet.c +1 -1
@@ -382,7 +382,7 @@ static int smc_pnet_add_eth(struct smc_pnettable *pnettable, struct net *net,if (ndev) { new_pe->ndev = ndev;netdev_tracker_alloc (ndev, &new_pe->dev_tracker, -GFP_KERNEL ); +GFP_ATOMIC ); }list_add_tail (&new_pe->list, &pnettable->pnetlist);write_unlock (&pnettable->lock);
Signature · 1 line
2.35.0.263.gb82422642f-goog
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:
Quoted 8 lines · On Sun, 6 Feb 2022 06:33:48 -0800 you wrote:
From: Eric Dumazet <[email protected]>
My last patch moved the
netdev_tracker_alloc()call to a section protected by awrite_lock().I should have replaced
GFP_KERNELwithGFP_ATOMICto avoid the infamous:[...]
Here is the summary with links:
- [net] net/smc: use GFP_ATOMIC allocation in smc_pnet_add_eth()
https://git.kernel.org/netdev/net/c/94fdd7c02a56
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html