aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsglob.h
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@etersoft.ru>2012-09-19 09:22:45 -0400
committerSteve French <smfrench@gmail.com>2012-09-24 22:46:33 -0400
commit233839b1df65a24c8b67b748fe7b18d86d0ad6d7 (patch)
treeba9af2849063c2213fc0fbecb494967f1e662806 /fs/cifs/cifsglob.h
parent0822f51426b51bd599b3a7e972b14aacaa045a92 (diff)
CIFS: Fix fast lease break after open problem
Now we walk though cifsFileInfo's list for every incoming lease break and look for an equivalent there. That approach misses lease breaks that come just after an open response - we don't have time to populate new cifsFileInfo structure to the list. Fix this by adding new list of pending opens and look for a lease there if we didn't find it in the list of cifsFileInfo structures. Signed-off-by: Pavel Shilovsky <pshilovsky@etersoft.ru> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsglob.h')
-rw-r--r--fs/cifs/cifsglob.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index b6ec142028e8..a39e5b7fc844 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -715,6 +715,7 @@ struct cifs_ses {
715 __u16 session_flags; 715 __u16 session_flags;
716#endif /* CONFIG_CIFS_SMB2 */ 716#endif /* CONFIG_CIFS_SMB2 */
717}; 717};
718
718/* no more than one of the following three session flags may be set */ 719/* no more than one of the following three session flags may be set */
719#define CIFS_SES_NT4 1 720#define CIFS_SES_NT4 1
720#define CIFS_SES_OS2 2 721#define CIFS_SES_OS2 2
@@ -821,6 +822,7 @@ struct cifs_tcon {
821 u64 resource_id; /* server resource id */ 822 u64 resource_id; /* server resource id */
822 struct fscache_cookie *fscache; /* cookie for share */ 823 struct fscache_cookie *fscache; /* cookie for share */
823#endif 824#endif
825 struct list_head pending_opens; /* list of incomplete opens */
824 /* BB add field for back pointer to sb struct(s)? */ 826 /* BB add field for back pointer to sb struct(s)? */
825}; 827};
826 828
@@ -863,6 +865,15 @@ cifs_get_tlink(struct tcon_link *tlink)
863/* This function is always expected to succeed */ 865/* This function is always expected to succeed */
864extern struct cifs_tcon *cifs_sb_master_tcon(struct cifs_sb_info *cifs_sb); 866extern struct cifs_tcon *cifs_sb_master_tcon(struct cifs_sb_info *cifs_sb);
865 867
868#define CIFS_OPLOCK_NO_CHANGE 0xfe
869
870struct cifs_pending_open {
871 struct list_head olist;
872 struct tcon_link *tlink;
873 __u8 lease_key[16];
874 __u32 oplock;
875};
876
866/* 877/*
867 * This info hangs off the cifsFileInfo structure, pointed to by llist. 878 * This info hangs off the cifsFileInfo structure, pointed to by llist.
868 * This is used to track byte stream locks on the file 879 * This is used to track byte stream locks on the file
@@ -903,6 +914,7 @@ struct cifs_fid {
903 __u64 volatile_fid; /* volatile file id for smb2 */ 914 __u64 volatile_fid; /* volatile file id for smb2 */
904 __u8 lease_key[SMB2_LEASE_KEY_SIZE]; /* lease key for smb2 */ 915 __u8 lease_key[SMB2_LEASE_KEY_SIZE]; /* lease key for smb2 */
905#endif 916#endif
917 struct cifs_pending_open *pending_open;
906}; 918};
907 919
908struct cifs_fid_locks { 920struct cifs_fid_locks {