Created attachment 10997 [details]
Raw patch for master.
From: Kenny Dinh <email@example.com>
To: samba-technical <firstname.lastname@example.org>
Subject: Incorrect file size returned in the Respond of "FILE_SUPERSEDE Create"
[-- Attachment #1 [details] --]
[-- Type: text/plain, Encoding: 7bit, Size: 0.8K --]
We were running a test in IFSTEST suite called "SupersideFileTest". The
test expects file size to be 0 after a successful open request, with
FILE_SUPERSEDE disposition, returned.
While handling FILE_SUPERSEDE disposition, SAMBA call vfswrap_ftruncate()
to truncate the file. However, the file size stored in
fsp->fsp_name->st.st_ex_size was not updated after ftruncate() is called.
As a result, the Create Respond for FILE_SUPERSEDE request contains the
stale file size instead of 0. The existing code simply returns if
ftruncate() succeeded. I moved the code such that we always call
vfs_stat_fsp() to update the file size in fsp->fsp_name->st.st_ex_size.
Could someone verify if the attached patch is correct is should be pulled
Created attachment 10998 [details]
git-am fix for master.
Created attachment 11006 [details]
git-am fix for 4.2.next.
Cherry-pick from master. Includes torture test.
Created attachment 11007 [details]
git-am fix for 4.1.next.
Cherry-pick from master. Doesn't include torture test for 4.1.next.
Re-assigning to Karolin for inclusion in 4.2.next, 4.1.next.
Pushed to autobuild-v4-[1|2]-test.
Pushed to both branches.
Closing out bug report.