Write times fix for S3

Stefan (metze) Metzmacher metze at samba.org
Mon Sep 8 05:48:11 GMT 2008

Jeremy Allison schrieb:
> Ok, here's the fix for the write times breakage
> with the new tests in S4 smbtorture.
> The key is keeping in the share mode struct
> the "old_file_time" as the real write time,
> set by all the write and allocation calls,
> and the "changed_write_time" as the "sticky"
> write time - set by the SET_FILE_TIME calls.
> We can set them independently (although I
> kept the optimization of not setting the
> "old_file_time" is a "changed_write_time"
> was already set, as we'll never see it.
> This allows us to update the write time
> immediately on the SMBwrite truncate case,
> whilst still have the 2 second delay on the
> "normal" SMBwrite, SMBwriteX calls.

We don't need special cases for SMBwrite truncate.

I think SMBwrite truncate, SET_END_OF_FILE and SET_ALLOCATION_SIZE
just need to be handled like an explicit set of the write time.

I'm adding some more code to the torture tests to verify this...

> I think in a subsequent patch I'd like to
> change the name of these from "old_file_time"
> to "write_time" and "changed_write_time" to
> "sticky_write_time" to make this clearer.
> I think I also fixed a bug in Metze's original
> code in that once a write timestamp had been
> set from a "normal" SMBwriteX call the fsp->update_write_time_triggered
> variable was set and then never reset - thus
> meaning the write timestamp would never get
> updated again on subsequent SMBwriteX's.

It's correct that it's never reset! And subsequent SMBwriteX's doesn't
update the write time!

> The new code checks the update_write_time_event
> event instead, and doesn't update is there's
> an event already scheduled.
> Metze especially, please check this over for
> your understanding.

Please don't apply your patch as it's not correct.
We need more torture tests first, before we can think of the
correct fix.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.samba.org/archive/samba-technical/attachments/20080908/50ad688c/signature.bin

More information about the samba-technical mailing list