smbd: let mark_file_modified() always call trigger_write_time_update()
authorRalph Boehme <slow@samba.org>
Sun, 15 Mar 2020 07:30:21 +0000 (08:30 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 19 Mar 2020 01:20:34 +0000 (01:20 +0000)
Preperatory change: the next commit will reset fsp->update_write_time_on_close
in the event handler, so this change ensures it gets set again for any
subsequent write.

This will NOT always result in a write-time update because
trigger_write_time_update() has its own only-once logic using the internal
variable fsp->update_write_time_triggered.

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>
source3/smbd/fileio.c

index 2487baeb36952ebe4d75df36ca20d5ed1f60a4ff..aba7f878b1759a018663427441df7d49b44841bf 100644 (file)
@@ -214,14 +214,14 @@ void mark_file_modified(files_struct *fsp)
 {
        int dosmode;
 
+       trigger_write_time_update(fsp);
+
        if (fsp->modified) {
                return;
        }
 
        fsp->modified = true;
 
-       trigger_write_time_update(fsp);
-
        if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) {
                return;
        }