diff mbox series

[net] net/smc: use GFP_ATOMIC allocation in smc_pnet_add_eth()

Message ID 20220206143348.350693-1-eric.dumazet@gmail.com (mailing list archive)
State Accepted
Commit 94fdd7c02a56d0316d20e417a1141b71a8dcee82
Delegated to: Netdev Maintainers
Headers show
Series [net] net/smc: use GFP_ATOMIC allocation in smc_pnet_add_eth() | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 2 maintainers not CCed: linux-s390@vger.kernel.org kgraul@linux.ibm.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Eric Dumazet Feb. 6, 2022, 2:33 p.m. UTC
From: Eric Dumazet <edumazet@google.com>

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 <edumazet@google.com>
---
 net/smc/smc_pnet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

patchwork-bot+netdevbpf@kernel.org Feb. 7, 2022, 12:10 p.m. UTC | #1
Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Sun,  6 Feb 2022 06:33:48 -0800 you wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> 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:
> 
> [...]

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!
diff mbox series

Patch

diff --git a/net/smc/smc_pnet.c b/net/smc/smc_pnet.c
index fb6331d97185a5db9b4539e7f081e9fa469bc44b..0599246c037690b4b01813956e4af74519277bea 100644
--- a/net/smc/smc_pnet.c
+++ b/net/smc/smc_pnet.c
@@ -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);