]> www.infradead.org Git - users/jedix/linux-maple.git/commit
IB/sa: Put netlink request into the request list before sending
authorKaike Wan <kaike.wan@intel.com>
Fri, 30 Oct 2015 12:23:45 +0000 (08:23 -0400)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 1 Jun 2017 06:15:47 +0000 (23:15 -0700)
commite516b6b31a0d3b4873eabfdda25e3ed303e1333e
treef489b352287c56ae0a16ac97d34637f53638025a
parentf9132941c4e456dc14fe5b4c0004958bd2cd9b75
IB/sa: Put netlink request into the request list before sending

Orabug: 26124118

It was found by Saurabh Sengar that the netlink code tried to allocate
memory with GFP_KERNEL while holding a spinlock. While it is possible
to fix the issue by replacing GFP_KERNEL with GFP_ATOMIC, it is better
to get rid of the spinlock while sending the packet. However, in order
to protect against a race condition that a quick response may be received
before the request is put on the request list, we need to put the request
on the list first.

Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reported-by: Saurabh Sengar <saurabh.truth@gmail.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
(cherry picked from commit 3ebd2fd0d0119a5ac7906bf17be637b527f63d31)

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com>
drivers/infiniband/core/sa_query.c