parse_dos_attribute_blob() inconsistent file_id through make_file_id_from_itime()

Ralph Boehme slow at
Fri Dec 13 08:58:45 UTC 2019

Am 12/12/19 um 11:26 PM schrieb Krasimir Ganchev via samba-technical:
> I have recently experienced some strange behavior while browsing folders with clients that respect SMB fileid e.g. most recent Windows 10, Windows 2019 Server, MacOS Catalina. On folders with multiple image files, on Windows there would be repeated thumbnails among files and on MacOS thumbnails for certain files would not be showed at all. This behavior could not be reproduced with older version of the mentioned OSes without fileid support in the SMB implementation.
> Tracking down the issue I noticed that copying files with multiple threads will often produce the same change timestamp for different batches of files even though we have granularity information from the underlying file system (e.g. we have proper nsec information).
> This is an issue because parse_dos_attribute_blob() is presented the same fileid for different files through make_file_id_from_itime(). The same method of getting fileid is also used in open_file_ntcreate().
> Looking at make_file_id_from_itime() I noticed that when ST_EX_IFLAG_CALCULATED_ITIME flag is unset this will return a fileid based of the invented time only which in the aforementioned case is producing the same fileid for files that have the same change timestamp in the underlying fs.
> Based on MS-SMB specification fileid must be unique for a file on a given object store and must persist for the lifetime of the file. It also should not be changed when a file is renamed.
> I am about to open a bug report and I would like to suggest a patch, but for the sakes of implementing the patch in a proper way I would like to ask if there is a particular reason why fileid is based only on itime in make_file_id_from_itime() when ST_EX_IFLAG_CALCULATED_ITIME is unset?

this is a recent Samba change to overcome the problematic use of inode
numbers for the file-ids. The assumption was that with nsec filesystem
timestamp granularity, the itime, which stands for invented time and is
basically an immutable birthtime, will alway be unique.

Can you share a network trace of a minimal reproducer?


Ralph Boehme, Samba Team      
Samba Developer, SerNet GmbH
GPG-Fingerprint   FAE2C6088A24252051C559E4AA1E9B7126399E46

More information about the samba-technical mailing list