Incorrect file size returned in the Respond of "FILE_SUPERSEDE Create"

Volker Lendecke Volker.Lendecke at SerNet.DE
Mon Apr 27 23:34:48 MDT 2015


On Mon, Apr 27, 2015 at 06:14:41PM -0700, Kenny Dinh wrote:
> Hi all,
> 
> 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
> upstream?

Patch looks great, this seems to be exactly the right spot.

Two minor comments:

We'd love to see this as git format-patch patch.

To make sure this never breaks again, is it possible to
create a torture test? If not, can you send us a small
wireshark trace, so that we can create one?

The same applies to your OPEN_BY_FILE_ID patch.

With best regards,

Volker Lendecke

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de


More information about the samba-technical mailing list