From: Ralph Boehme Date: Mon, 9 Sep 2019 09:12:08 +0000 (+0200) Subject: s3:lib: round itime to NTTIME resolution in make_file_id_from_itime() X-Git-Tag: talloc-2.3.1~937 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=84abeaa60ffced276da2b28b8add6efaa6da5ca6;p=thirdparty%2Fsamba.git s3:lib: round itime to NTTIME resolution in make_file_id_from_itime() The rounding is needed because when a file is created via eg an SMB2 CREATE request, we need to calculate the correct File-ID for the QFID Create-Context or for a subsequent GETINFO SMB request on the same file-handle. Any later metadata request that received the File-ID will do so by going through dos_mode() -> ... -> parse_dos_attribute_blob(), where the File-ID will be calculated from the on-disk itime which has NTTIME resolution. As long as that is the only available itime backend, I'm rounding itime inside make_file_id_from_itime(), not in the callers. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14121 Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- diff --git a/source3/lib/file_id.c b/source3/lib/file_id.c index 7d4fb006afe..21f22ffbf3b 100644 --- a/source3/lib/file_id.c +++ b/source3/lib/file_id.c @@ -102,6 +102,8 @@ uint64_t make_file_id_from_itime(SMB_STRUCT_STAT *st) return ino; } + round_timespec_to_nttime(&itime); + file_id_low = itime.tv_nsec; if (file_id_low == 0) { /*