summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2019-08-15 12:10:52 +0200
committerJeremy Allison <jra@samba.org>2019-09-17 22:49:36 +0000
commitd12421ace457d1fdca0d97e2c680e90edf556967 (patch)
treef4dc1134ef2dd04db79d68b424a4e9f9289e2300 /source3/include
parentcc2e5b41646f6c18288ffb4b0ea16f4ea2cb4874 (diff)
downloadsamba-d12421ace457d1fdca0d97e2c680e90edf556967.tar.gz
smbd: Let fsp_lease_type() look at leases.tdb
The same lease can be used via different TCP connections (yes, we have tests for this!). At the end of downgrade_lease() we update all fsp's with fsps_lease_update() that link to the lease that just was changed. However, this is only in the local process, this is not cross-smbd. So other smbds using the same lease can use stale information and for example get the mandatory locking wrong. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/vfs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index fef68396221..3c80a5fdd33 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -354,6 +354,14 @@ typedef struct files_struct {
bool write_time_forced;
int oplock_type;
+
+ /*
+ * Cache of our lease_type, stored as "current_state" in
+ * leases.tdb
+ */
+ int leases_db_seqnum;
+ uint32_t lease_type;
+
struct fsp_lease *lease;
int sent_oplock_break;
struct tevent_timer *oplock_timeout;