summaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsfs.c
diff options
context:
space:
mode:
authorJeff Layton2010-09-30 01:51:11 +0200
committerSteve French2010-10-06 18:12:49 +0200
commit13cfb7334eb6fd0fc06da5589aea1e947791f1d6 (patch)
tree56d884f6a5dbcf8b259247fdad55c9158bd4d865 /fs/cifs/cifsfs.c
parentcifs: add refcounted and timestamped container for holding tcons (diff)
downloadkernel-qcow2-linux-13cfb7334eb6fd0fc06da5589aea1e947791f1d6.tar.gz
kernel-qcow2-linux-13cfb7334eb6fd0fc06da5589aea1e947791f1d6.tar.xz
kernel-qcow2-linux-13cfb7334eb6fd0fc06da5589aea1e947791f1d6.zip
cifs: have cifsFileInfo hold a reference to a tlink rather than tcon pointer
cifsFileInfo needs a pointer to a tcon, but it doesn't currently hold a reference to it. Change it to keep a pointer to a tcon_link instead and hold a reference to it. That will keep the tcon from being freed until the file is closed. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r--fs/cifs/cifsfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 898d2a5cfad2..b2fd075dc2e6 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -595,7 +595,8 @@ static int cifs_setlease(struct file *file, long arg, struct file_lock **lease)
((arg == F_WRLCK) &&
(CIFS_I(inode)->clientCanCacheAll)))
return generic_setlease(file, arg, lease);
- else if (cfile->tcon->local_lease && !CIFS_I(inode)->clientCanCacheRead)
+ else if (tlink_tcon(cfile->tlink)->local_lease &&
+ !CIFS_I(inode)->clientCanCacheRead)
/* If the server claims to support oplock on this
file, then we still need to check oplock even
if the local_lease mount option is set, but there