]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: let delayed update handler also update on-disk timestamps
authorRalph Boehme <slow@samba.org>
Sun, 15 Mar 2020 07:30:21 +0000 (08:30 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 7 Apr 2020 09:37:25 +0000 (09:37 +0000)
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

(back ported from commit 81c1a14e3271aeed7ed4fe6311171b19ba963555)

source3/smbd/fileio.c

index 8e3412613d01477ea42d9070203ccc8362c1262a..36ff6344a5dfcb88904308ed3cada577c1e5e562 100644 (file)
@@ -169,15 +169,7 @@ void fsp_flush_write_time_update(struct files_struct *fsp)
 
        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,