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

Kenny Dinh kdinh at peaxy.net
Mon Apr 27 19:14:41 MDT 2015


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?

Thanks,
Kenny
-------------- next part --------------
A non-text attachment was scrubbed...
Name: supersede_patch
Type: application/octet-stream
Size: 846 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150427/1aa61750/attachment.obj>


More information about the samba-technical mailing list