diff options
author | Sagi Grimberg <sagi@grimberg.me> | 2020-02-25 16:43:24 -0800 |
---|---|---|
committer | Keith Busch <kbusch@kernel.org> | 2020-03-26 04:51:45 +0900 |
commit | 761ad26c45b0260a8516bc1fc9d25bb66ca4e25c (patch) | |
tree | 0ba14692fcb25e42e2499481e8072606fb58a7f1 | |
parent | 5ff4e11264780ce49a9acb66e0b4c5a30a569be4 (diff) | |
download | linux-761ad26c45b0260a8516bc1fc9d25bb66ca4e25c.tar.gz linux-761ad26c45b0260a8516bc1fc9d25bb66ca4e25c.tar.bz2 linux-761ad26c45b0260a8516bc1fc9d25bb66ca4e25c.zip |
nvme-tcp: break from io_work loop if recv failed
If we failed to receive data from the socket, don't try
to further process it, we will for sure be handling a queue
error at this point. While no issue was seen with the
current behavior thus far, its safer to cease socket processing
if we detected an error.
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
-rw-r--r-- | drivers/nvme/host/tcp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 221a5a59aa06..4b20301e517c 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -1074,6 +1074,8 @@ static void nvme_tcp_io_work(struct work_struct *w) result = nvme_tcp_try_recv(queue); if (result > 0) pending = true; + else if (unlikely(result < 0)) + break; if (!pending) return; |