]> git.baikalelectronics.ru Git - kernel.git/commit
CIFS: Close cached root handle only if it has a lease
authorPavel Shilovsky <pshilov@microsoft.com>
Tue, 10 Dec 2019 19:44:52 +0000 (11:44 -0800)
committerSteve French <stfrench@microsoft.com>
Fri, 13 Dec 2019 06:49:57 +0000 (00:49 -0600)
commit35cc1182eb0162d8a0e065787d8eb57e0db8f303
tree4ab99f916e843ee00f63d7b2c32b062bdef55499
parent1e2684d114500824f3100fd4589dca09a3b01de3
CIFS: Close cached root handle only if it has a lease

SMB2_tdis() checks if a root handle is valid in order to decide
whether it needs to close the handle or not. However if another
thread has reference for the handle, it may end up with putting
the reference twice. The extra reference that we want to put
during the tree disconnect is the reference that has a directory
lease. So, track the fact that we have a directory lease and
close the handle only in that case.

Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/cifsglob.h
fs/cifs/cifssmb.c
fs/cifs/smb2ops.c
fs/cifs/smb2pdu.c
fs/cifs/smb2proto.h