OSDN Git Service

cifs: Fix potential softlockups while refreshing DFS cache
authorPaulo Alcantara (SUSE) <pc@cjr.nz>
Fri, 22 Nov 2019 15:30:53 +0000 (12:30 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2019 19:35:58 +0000 (20:35 +0100)
commit14cb20ad6bfcd3b66ce5defa5b2d3d4c4553c9a9
tree8b33f5046e81326b3a6d0dd956bc9f40174aac0a
parent12c88d91a82f30e54febb95fa68f6ce75108e22f
cifs: Fix potential softlockups while refreshing DFS cache

[ Upstream commit 84a1f5b1cc6fd7f6cd99fc5630c36f631b19fa60 ]

We used to skip reconnects on all SMB2_IOCTL commands due to SMB3+
FSCTL_VALIDATE_NEGOTIATE_INFO - which made sense since we're still
establishing a SMB session.

However, when refresh_cache_worker() calls smb2_get_dfs_refer() and
we're under reconnect, SMB2_ioctl() will not be able to get a proper
status error (e.g. -EHOSTDOWN in case we failed to reconnect) but an
-EAGAIN from cifs_send_recv() thus looping forever in
refresh_cache_worker().

Fixes: e99c63e4d86d ("SMB3: Fix deadlock in validate negotiate hits reconnect")
Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Suggested-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/cifs/smb2pdu.c