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 08:12:37 +0000 (08:12 +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

(cherry picked from commit 81c1a14e3271aeed7ed4fe6311171b19ba963555)

selftest/knownfail.d/samba3.smb2.timestamps [deleted file]
source3/smbd/fileio.c

diff --git a/selftest/knownfail.d/samba3.smb2.timestamps b/selftest/knownfail.d/samba3.smb2.timestamps
deleted file mode 100644 (file)
index dd4aeb5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.smb2.timestamps.delayed-1write\(.*\)$
index aba7f878b1759a018663427441df7d49b44841bf..31d5b7510b742f9d83f8249ca2c695bb11e64650 100644 (file)
@@ -104,15 +104,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,