diff options
author | Sagi Grimberg <sagi@grimberg.me> | 2018-09-03 03:47:07 -0700 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-09-05 12:18:01 -0700 |
commit | 8407879c4e0d7731f6e7e905893cecf61a7762c7 (patch) | |
tree | e0d0ac2f54a1de859be50333a3015a627defb067 /ipc | |
parent | bc811f05d77f47059c197a98b6ad242eb03999cb (diff) | |
download | blackbird-op-linux-8407879c4e0d7731f6e7e905893cecf61a7762c7.tar.gz blackbird-op-linux-8407879c4e0d7731f6e7e905893cecf61a7762c7.zip |
nvmet-rdma: fix possible bogus dereference under heavy load
Currently we always repost the recv buffer before we send a response
capsule back to the host. Since ordering is not guaranteed for send
and recv completions, it is posible that we will receive a new request
from the host before we got a send completion for the response capsule.
Today, we pre-allocate 2x rsps the length of the queue, but in reality,
under heavy load there is nothing that is really preventing the gap to
expand until we exhaust all our rsps.
To fix this, if we don't have any pre-allocated rsps left, we dynamically
allocate a rsp and make sure to free it when we are done. If under memory
pressure we fail to allocate a rsp, we silently drop the command and
wait for the host to retry.
Reported-by: Steve Wise <swise@opengridcomputing.com>
Tested-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
[hch: dropped a superflous assignment]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'ipc')
0 files changed, 0 insertions, 0 deletions