[PATCH 5.4 23/76] cifs: fix interrupted close commands

From: Greg Kroah-Hartman
Date: Mon Jan 18 2021 - 14:14:41 EST


From: Paulo Alcantara <pc@xxxxxx>

[ 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@xxxxxx>
Reported-by: Duncan Findlay <duncf@xxxxxxxx>
Suggested-by: Pavel Shilovsky <pshilov@xxxxxxxxxxxxx>
Fixes: 6988a619f5b7 ("cifs: allow syscalls to be restarted in __smb_send_rqst()")
Cc: stable@xxxxxxxxxxxxxxx
Reviewd-by: Pavel Shilovsky <pshilov@xxxxxxxxxxxxx>
Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
fs/cifs/smb2pdu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index c095f2e6b0825..be06b26d6ca03 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -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,
--
2.27.0