Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

RDMA/addr: Mark addr_resolve as might_sleep()

Under one path through ib_nl_fetch_ha() this calls nlmsg_new(GFP_KERNEL)
which is a sleeping call. This is a very rare path, so mark fetch_ha() and
the module external entry point that conditionally calls through to
fetch_ha() as might_sleep().

Link: https://lore.kernel.org/r/20200506074701.9775-2-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>

+4
+4
drivers/infiniband/core/addr.c
··· 371 371 (const void *)&dst_in6->sin6_addr; 372 372 sa_family_t family = dst_in->sa_family; 373 373 374 + might_sleep(); 375 + 374 376 /* If we have a gateway in IB mode then it must be an IB network */ 375 377 if (has_gateway(dst, family) && dev_addr->network == RDMA_NETWORK_IB) 376 378 return ib_nl_fetch_ha(dev_addr, daddr, seq, family); ··· 728 726 } sgid, dgid; 729 727 struct rdma_dev_addr dev_addr = {}; 730 728 int ret; 729 + 730 + might_sleep(); 731 731 732 732 if (rec->roce.route_resolved) 733 733 return 0;