[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [PATCH] dlm: fix coverity-spotted stupidity



This patch fixes the EAGAIN checking in lowcomms-tcp.c so it actually works.
Thanks to Adrian Bunk & the coverity checker for spotting that

Signed-Off-By: Patrick Caulfield <pcaulfie redhat com>

-- 

patrick
diff --git a/fs/dlm/lowcomms-tcp.c b/fs/dlm/lowcomms-tcp.c
index 07e0a12..3e7dd8a 100644
--- a/fs/dlm/lowcomms-tcp.c
+++ b/fs/dlm/lowcomms-tcp.c
@@ -316,10 +317,10 @@ static int receive_from_sock(struct connection *con)
 	r = ret = kernel_recvmsg(con->sock, &msg, iov, nvec, len,
 			       MSG_DONTWAIT | MSG_NOSIGNAL);
 
-	if (ret <= 0)
-		goto out_close;
 	if (ret == -EAGAIN)
 		goto out_resched;
+	if (ret <= 0)
+		goto out_close;
 
 	if (ret == len)
 		call_again_soon = 1;

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]