]> git.ipfire.org Git - people/ms/linux.git/commitdiff
nvme-tcp: break from io_work loop if recv failed
authorSagi Grimberg <sagi@grimberg.me>
Wed, 26 Feb 2020 00:43:24 +0000 (16:43 -0800)
committerKeith Busch <kbusch@kernel.org>
Wed, 25 Mar 2020 19:51:45 +0000 (04:51 +0900)
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>
drivers/nvme/host/tcp.c

index 221a5a59aa062ec76b53bccd9857b1cf11cabef1..4b20301e517ca46fe68406bccf9b01eafcbb3264 100644 (file)
@@ -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;