Let delayed update handler also update on-disk timestamps by calling
trigger_write_time_update_immediate().
trigger_write_time_update_immediate() sets fsp->update_write_time_on_close to
false which prevents updating the write-time on close if there was ever only one
write to the file.
Besides resetting fsp->update_write_time_on_close and setting the on-disk timestamps
trigger_write_time_update_immediate() takes the same steps as the removed code.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14320
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar 19 03:05:40 UTC 2020 on sn-devel-184
(cherry picked from commit
81c1a14e3271aeed7ed4fe6311171b19ba963555)
+++ /dev/null
-^samba3.smb2.timestamps.delayed-1write\(.*\)$
DEBUG(5, ("Update write time on %s\n", fsp_str_dbg(fsp)));
- /* change the write time in the open file db. */
- (void)set_write_time(fsp->file_id, timespec_current());
-
- /* And notify. */
- notify_fname(fsp->conn, NOTIFY_ACTION_MODIFIED,
- FILE_NOTIFY_CHANGE_LAST_WRITE, fsp->fsp_name->base_name);
-
- /* Remove the timed event handler. */
- TALLOC_FREE(fsp->update_write_time_event);
+ trigger_write_time_update_immediate(fsp);
}
static void update_write_time_handler(struct tevent_context *ctx,