s3:smbd: add a comment explaining the File-ID semantics when a file is created
authorRalph Boehme <slow@samba.org>
Thu, 26 Sep 2019 17:41:37 +0000 (10:41 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 2 Oct 2019 08:01:40 +0000 (08:01 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14137

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/open.c

index e9c332e3e8c9ca6358456d09debd8a7407fbc420..5860155263b5a1bb8d7f50fbcc51702e3259c299 100644 (file)
@@ -3936,6 +3936,15 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
                fsp->initial_delete_on_close = True;
        }
 
+       /*
+        * If we created a file and it's not a stream, this is the point where
+        * we set the itime (aka invented time) that get's stored in the DOS
+        * attribute xattr. The value is going to be either what the filesystem
+        * provided or a copy of the creation date.
+        *
+        * Either way, we turn the itime into a File-ID, unless the filesystem
+        * provided one (unlikely).
+        */
        if (info == FILE_WAS_CREATED && !is_named_stream(smb_fname)) {
                smb_fname->st.st_ex_iflags &= ~ST_EX_IFLAG_CALCULATED_ITIME;