s3:smbd: let update_write_time_on_close() use share_mode_{old,changed}_write_time()
authorStefan Metzmacher <metze@samba.org>
Tue, 30 Aug 2022 05:57:48 +0000 (05:57 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 20 Sep 2022 00:34:35 +0000 (00:34 +0000)
We're already holding a share_mode_lock, so we can use it directly.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/close.c

index 4306a59342f8744f2375570980ab52c35183afb7..d50d34229b7c39843bbe6addfafbee5490337175 100644 (file)
@@ -608,12 +608,12 @@ static NTSTATUS update_write_time_on_close(struct files_struct *fsp)
                NTTIME share_mtime = share_mode_changed_write_time(lck);
                /* On close if we're changing the real file time we
                 * must update it in the open file db too. */
-               (void)set_write_time(fsp->file_id, fsp->close_write_time);
+               share_mode_set_old_write_time(lck, fsp->close_write_time);
 
                /* Close write times overwrite sticky write times
                   so we must replace any sticky write time here. */
                if (!null_nttime(share_mtime)) {
-                       (void)set_sticky_write_time(fsp->file_id, fsp->close_write_time);
+                       share_mode_set_changed_write_time(lck, fsp->close_write_time);
                }
                TALLOC_FREE(lck);
        }