BUG: https://bugzilla.samba.org/show_bug.cgi?id=15894
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
+++ /dev/null
-^samba3.smb2.lease.lock3\(fileserver\)
} else {
if (flags & O_TRUNC) {
info = FILE_WAS_OVERWRITTEN;
+ /*
+ * We did not truncate the file yet, we're doing that
+ * explicitly with SMB_VFS_FTRUNCATE() below under the
+ * sharemode glock. For correct handling of RH leases in
+ * the presence of byterange locks, the leases code
+ * needs the "correct" filesize which should be 0 at
+ * this place if we did the O_TRUNC at open() time.
+ */
+ fsp->fsp_name->st.st_ex_size = 0;
} else {
info = FILE_WAS_OPENED;
}