]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
cifs: fix interrupted close commands
authorPaulo Alcantara <pc@cjr.nz>
Wed, 13 Jan 2021 17:16:16 +0000 (14:16 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Jan 2021 17:26:13 +0000 (18:26 +0100)
[ Upstream commit 2659d3bff3e1b000f49907d0839178b101a89887 ]

Retry close command if it gets interrupted to not leak open handles on
the server.

Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Reported-by: Duncan Findlay <duncf@duncf.ca>
Suggested-by: Pavel Shilovsky <pshilov@microsoft.com>
Fixes: 6988a619f5b7 ("cifs: allow syscalls to be restarted in __smb_send_rqst()")
Cc: stable@vger.kernel.org
Reviewd-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/cifs/smb2pdu.c

index c095f2e6b08258d24eec03c9cbd2a69ae010d724..be06b26d6ca033f51ca547d751b336634b5fb317 100644 (file)
@@ -2996,7 +2996,7 @@ close_exit:
        free_rsp_buf(resp_buftype, rsp);
 
        /* retry close in a worker thread if this one is interrupted */
-       if (rc == -EINTR) {
+       if (is_interrupt_error(rc)) {
                int tmp_rc;
 
                tmp_rc = smb2_handle_cancelled_close(tcon, persistent_fid,