diff options
author | Stefan Metzmacher <metze@samba.org> | 2014-11-06 09:23:46 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2014-11-06 13:09:38 +0100 |
commit | fbe40d21c8e0f5bc87635e71fb828dfc5479a1ff (patch) | |
tree | b5db9dd6f1c15f80c6b2f5517cd2af29d1832be5 | |
parent | 10e888f6cee8cdc4c905d3c2788a47901bd42b2c (diff) | |
download | samba-fbe40d21c8e0f5bc87635e71fb828dfc5479a1ff.tar.gz samba-fbe40d21c8e0f5bc87635e71fb828dfc5479a1ff.tar.xz samba-fbe40d21c8e0f5bc87635e71fb828dfc5479a1ff.zip |
s3:smbd: fix file corruption using "write cache size != 0"
A client can:
- open a handle (h1)
- write some data to h1.
- open a 2nd handle h2 (downgrades both handles to level II)
- try to read the data on h2 (this gets old data)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10921
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Nov 6 13:09:38 CET 2014 on sn-devel-104
-rw-r--r-- | source3/smbd/oplock.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index 17cb22e847..79350923c3 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -142,6 +142,9 @@ static void downgrade_file_oplock(files_struct *fsp) sconn->oplocks.level_II_open++; fsp->sent_oplock_break = NO_BREAK_SENT; + flush_write_cache(fsp, SAMBA_OPLOCK_RELEASE_FLUSH); + delete_write_cache(fsp); + TALLOC_FREE(fsp->oplock_timeout); } |