From f99b617c0c0cb4ffa52d8ac0732b8600974693d0 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 29 Jun 2022 17:06:12 +0200 Subject: [PATCH] s3:vfs_fileid: also imply the generic nolock logic to the legacy 'hostname' algorithm That way the file_id.extid is consistenly filled for all cases where we deliberately break lock coherency. This will simplify further changes and give administrators more flexibility. Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme --- source3/modules/vfs_fileid.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source3/modules/vfs_fileid.c b/source3/modules/vfs_fileid.c index c491320c253..9ef0d6919df 100644 --- a/source3/modules/vfs_fileid.c +++ b/source3/modules/vfs_fileid.c @@ -51,6 +51,7 @@ struct fileid_handle_data { unsigned num_mount_entries; struct fileid_mount_entry *mount_entries; struct { + bool force_all_inodes; bool force_all_dirs; uint64_t extid; size_t num_inodes; @@ -277,6 +278,10 @@ static bool fileid_is_nolock_inode(struct fileid_handle_data *data, { size_t i; + if (data->nolock.force_all_inodes) { + return true; + } + if (S_ISDIR(sbuf->st_ex_mode) && data->nolock.force_all_dirs) { return true; } @@ -502,6 +507,7 @@ static int fileid_connect(struct vfs_handle_struct *handle, data->mapping_fn = fileid_mapping_fsid; } else if (strcmp("hostname", algorithm) == 0) { data->mapping_fn = fileid_mapping_hostname; + data->nolock.force_all_inodes = true; } else if (strcmp("fsname_norootdir", algorithm) == 0) { data->mapping_fn = fileid_mapping_fsname; rootdir_nolock = true; -- 2.47.3