[HEADS-UP] Using stored immutable file birth time for SMB File-ID

David Disseldorp ddiss at samba.org
Thu Jun 27 14:21:37 UTC 2019


Hi Ralph,

Another follow-up here, after looking at your patchset...

On Wed, 26 Jun 2019 15:57:46 +0200, Ralph Boehme via samba-technical wrote:

> As a file's creation time (or btime for birth-time) may be set by clients, this 
> would result in changed File-IDs every time a client sets the btime. So we need 
> to store an additional copy of a file's original btime. We store the btime as 
> part of the DOS attributes xattr, we need an additional field in there, making 
> for a new level 4 of the xattr info struct.

IIUC, Btrfs, XFS, ext4 and f2fs already expose an *immutable* btime via
statx. See the discussion in https://patchwork.kernel.org/cover/10812257

I'd also imagine that there are FSes out there that can offer their own
immutable never-recycled File-ID.

Ideally your patchset could cater to both cases by allowing for
make_file_index_from_btime() / update_stat_ex_file_index() calls in the
VFS stat handler and avoiding the extra dosmode games if the
st_ex_file_index is already set.

As a minor nit, I think it'd make sense to combine the new stat_ex bools
into a single flags entry which includes calculated[_original]_birthtime
etc.

Cheers, David



More information about the samba-technical mailing list