diff options
author | Pavel Shilovsky <pshilov@microsoft.com> | 2019-12-10 11:44:52 -0800 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2019-12-13 00:49:57 -0600 |
commit | d9191319358da13ee6a332fb9bf745f2181a612a (patch) | |
tree | 4ab99f916e843ee00f63d7b2c32b062bdef55499 /fs/cifs/smb2pdu.c | |
parent | e0fc5b1153b81571d6ff80902a54c3eb13319b33 (diff) | |
download | linux-d9191319358da13ee6a332fb9bf745f2181a612a.tar.gz linux-d9191319358da13ee6a332fb9bf745f2181a612a.tar.bz2 linux-d9191319358da13ee6a332fb9bf745f2181a612a.zip |
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>
Diffstat (limited to 'fs/cifs/smb2pdu.c')
-rw-r--r-- | fs/cifs/smb2pdu.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index d2658f51ff60..9434f6dd8df3 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -1847,8 +1847,7 @@ SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon) if ((tcon->need_reconnect) || (tcon->ses->need_reconnect)) return 0; - if (tcon->crfid.is_valid) - close_shroot(&tcon->crfid); + close_shroot_lease(&tcon->crfid); rc = smb2_plain_req_init(SMB2_TREE_DISCONNECT, tcon, (void **) &req, &total_len); |