]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: flush pending writetime update when setting timestamps file
authorRalph Boehme <slow@samba.org>
Thu, 12 Mar 2020 18:23:40 +0000 (19:23 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 19 Mar 2020 01:20:34 +0000 (01:20 +0000)
Cf the explanations in the previous commits.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
selftest/knownfail.d/samba3.smb2.timestamps [deleted file]
source3/smbd/reply.c
source3/smbd/trans2.c

diff --git a/selftest/knownfail.d/samba3.smb2.timestamps b/selftest/knownfail.d/samba3.smb2.timestamps
deleted file mode 100644 (file)
index 8a52d4a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.smb2.timestamps.delayed-write-vs-setbasic\(.*\)$
index f809837f1cbfe7b6e871ede8e2dcf9b62c837899..5e2c26693109a68f93edcf5f28a00e50f3c2be17 100644 (file)
@@ -9437,6 +9437,10 @@ void reply_setattrE(struct smb_request *req)
                goto out;
        }
 
+       if (fsp->modified) {
+               trigger_write_time_update_immediate(fsp);
+       }
+
        DEBUG( 3, ( "reply_setattrE %s actime=%u modtime=%u "
               " createtime=%u\n",
                fsp_fnum_dbg(fsp),
index 8000e1ae924e361a9e980f4a165e0c15b0d93d85..5b7333773bbb523e32379c524ca9df8ba1ad8de9 100644 (file)
@@ -7836,8 +7836,15 @@ static NTSTATUS smb_set_file_basic_info(connection_struct *conn,
        DEBUG(10, ("smb_set_file_basic_info: file %s\n",
                   smb_fname_str_dbg(smb_fname)));
 
-       return smb_set_file_time(conn, fsp, smb_fname, &ft,
-                                true);
+       status = smb_set_file_time(conn, fsp, smb_fname, &ft, true);
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (fsp != NULL && fsp->modified) {
+               trigger_write_time_update_immediate(fsp);
+       }
+       return NT_STATUS_OK;
 }
 
 /****************************************************************************
@@ -7874,11 +7881,15 @@ static NTSTATUS smb_set_info_standard(connection_struct *conn,
                return status;
        }
 
-        return smb_set_file_time(conn,
-                                fsp,
-                               smb_fname,
-                               &ft,
-                                true);
+       status = smb_set_file_time(conn, fsp, smb_fname, &ft, true);
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       if (fsp != NULL && fsp->modified) {
+               trigger_write_time_update_immediate(fsp);
+       }
+       return NT_STATUS_OK;
 }
 
 /****************************************************************************