]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: do not fail __smb_send_rqst if non-fatal signals are pending
authorRonnie Sahlberg <lsahlber@redhat.com>
Wed, 20 Jan 2021 22:22:48 +0000 (08:22 +1000)
committerSteve French <stfrench@microsoft.com>
Sat, 23 Jan 2021 07:28:20 +0000 (01:28 -0600)
commit51ca6b12c69024e6ec2d04d9f51179349bb200e3
tree52c616384ee424d55838edf0cece6a918f0d3280
parent380ece93ecb44ada289938d5b6e30c90209e2dc3
cifs: do not fail __smb_send_rqst if non-fatal signals are pending

RHBZ 1848178

The original intent of returning an error in this function
in the patch:
  "CIFS: Mask off signals when sending SMB packets"
was to avoid interrupting packet send in the middle of
sending the data (and thus breaking an SMB connection),
but we also don't want to fail the request for non-fatal
signals even before we have had a chance to try to
send it (the reported problem could be reproduced e.g.
by exiting a child process when the parent process was in
the midst of calling futimens to update a file's timestamps).

In addition, since the signal may remain pending when we enter the
sending loop, we may end up not sending the whole packet before
TCP buffers become full. In this case the code returns -EINTR
but what we need here is to return -ERESTARTSYS instead to
allow system calls to be restarted.

Fixes: 5255b28f843f ("CIFS: Mask off signals when sending SMB packets")
Cc: stable@vger.kernel.org # v5.1+
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/transport.c