Don't overwrite creation time if set by make_create_timespec
jra at samba.org
Wed Mar 12 11:23:06 MDT 2014
On Wed, Mar 12, 2014 at 02:40:27PM +0100, Ralph Böhme wrote:
> Hi Jeremy,
> thanks for looking into this.
> On Tue, Mar 11, 2014 at 04:59:03PM -0700, Jeremy Allison wrote:
> > On Mon, Mar 10, 2014 at 05:59:41PM +0100, Ralph Böhme wrote:
> > > smb2_create calls dos_mode() after calling SMB_VFS_CREATE_FILE(), as a
> > > result the creation time as set by make_create_timespec() is always
> > > overwritten.
> > >
> > > Add a check to dos_mode() that tests for st_ex_calculated_birthtime ==
> > > true and only then update the creation time with the value from the
> > > DOS attribute xattr.
> > >
> > > Review appreciated. Thanks!
> > OK, I'm not sure this change is correct. What bug are
> > you trying to fix here ?
> not being able to set st_ex_btime from a VFS module without being
> overwritten by dos_mode().
That's what you're trying to achieve, that's NOT what
you're trying to fix. Please explain the ACTUAL BUG
in Samba that you're running into.
> I'm working on a new VFS module with enhanced streams support for
> Apple SMB clients and other stuff like Netatalk metadata compatibiliy
> . In the VFS module's stat() routines I'm reading a files creation
> date from Netatalk's stored Apple metadata and use that value for
> setting btime.
So we're getting closer to your actual problem, but
you're still making this painful to understand.
Returning your btime from the Netatalk metadata is
fine, but if there is a different btime set inside
Samba's xattr DOS metadata that needs to override
Consider this case. You have a file created by
Netatalk but not accessed by Samba so there
is no Samba metadata. Samba opens this. You
return a btime from your metadata into the
stat struct. Samba should use this to write
out it's own metadata including the btime
you returned into it's own metadata. Where
is the bug ? Please explain this as a sequence
of client actions that end up with the wrong
btime being returned.
> I see. So what would be needed is a proper way to let VFS modules set
> btime without dos_mode() overwriting it. *scratches head*
Again, that's what you think you want to do,
not what your actual problem is. *Why* do
you need to do this ?
Explain *carefully* how you expect btime
to behave please, and under what circumstances
this should be different from what smbd
More information about the samba-technical