CIFS: fix deadlock in cached root handling
authorAurelien Aptel <aaptel@suse.com>
Wed, 17 Jul 2019 10:46:28 +0000 (12:46 +0200)
committerSteve French <stfrench@microsoft.com>
Thu, 18 Jul 2019 18:51:35 +0000 (13:51 -0500)
commit7e5a70ad88b1e6f6d9b934b2efb41afff496820f
tree9c13366cebf1ad4eccc41e40ca9005e55305d2f5
parentae9b728c8dc0a9939d89f84e8603258ca2a0df22
CIFS: fix deadlock in cached root handling

Prevent deadlock between open_shroot() and
cifs_mark_open_files_invalid() by releasing the lock before entering
SMB2_open, taking it again after and checking if we still need to use
the result.

Link: https://lore.kernel.org/linux-cifs/684ed01c-cbca-2716-bc28-b0a59a0f8521@prodrive-technologies.com/T/#u
Fixes: 3d4ef9a15343 ("smb3: fix redundant opens on root")
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
CC: Stable <stable@vger.kernel.org>
fs/cifs/smb2ops.c