Web lists-archives.com

Fwd: [PATCH 4/7] CIFS: Do not hide EINTR after sending network packets




Pavel's patch looks correct to me, but since this may be a common
issue, how to better handle unexpected EINTR on sock_sendmsg, others
outside cifs/smb3 world may have run into this before and have
additional comments.

---------- Forwarded message ---------
From: Pavel Shilovsky <piastryyy@xxxxxxxxx>
Date: Thu, Jan 10, 2019 at 4:25 PM
Subject: [PATCH 4/7] CIFS: Do not hide EINTR after sending network packets
To: <linux-cifs@xxxxxxxxxxxxxxx>
Cc: Steve French <smfrench@xxxxxxxxx>, Ronnie Sahlberg <lsahlber@xxxxxxxxxx>


Currently we hide EINTR code returned from sock_sendmsg()
and return 0 instead. This makes a caller think that we
have successfully completed the network operation which is
not true. Fix this by properly returning EINTR to callers.

Cc: <stable@xxxxxxxxxxxxxxx>
Signed-off-by: Pavel Shilovsky <pshilov@xxxxxxxxxxxxx>
---
 fs/cifs/transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index e047f06..aaff9c5 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -387,7 +387,7 @@ __smb_send_rqst(struct TCP_Server_Info *server,
int num_rqst,
        if (rc < 0 && rc != -EINTR)
                cifs_dbg(VFS, "Error %d sending data on socket to server\n",
                         rc);
-       else
+       else if (rc > 0)
                rc = 0;

        return rc;
--
2.7.4



-- 
Thanks,

Steve