summaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2inode.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <lsahlber@redhat.com>2018-07-31 00:48:22 +0200
committerSteve French <stfrench@microsoft.com>2018-08-07 21:20:22 +0200
commit9da6ec7775d2cd76df53fbf4f1f35f6d490204f5 (patch)
tree4b94d5c7acde55bde6f42779a986c9de3268d513 /fs/cifs/smb2inode.c
parentsmb3: add reconnect tracepoints (diff)
downloadlinux-9da6ec7775d2cd76df53fbf4f1f35f6d490204f5.tar.xz
linux-9da6ec7775d2cd76df53fbf4f1f35f6d490204f5.zip
cifs: use a refcount to protect open/closing the cached file handle
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Steve French <stfrench@microsoft.com> Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com> Cc: <stable@vger.kernel.org>
Diffstat (limited to 'fs/cifs/smb2inode.c')
-rw-r--r--fs/cifs/smb2inode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c
index d01ad706d7fc..f22cbc0d1869 100644
--- a/fs/cifs/smb2inode.c
+++ b/fs/cifs/smb2inode.c
@@ -120,7 +120,9 @@ smb2_open_op_close(const unsigned int xid, struct cifs_tcon *tcon,
break;
}
- if (use_cached_root_handle == false)
+ if (use_cached_root_handle)
+ close_shroot(&tcon->crfid);
+ else
rc = SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid);
if (tmprc)
rc = tmprc;