s3:vfs_fileid: add 'fileid:nolock_all_inodes = BOOL'
authorStefan Metzmacher <metze@samba.org>
Wed, 29 Jun 2022 15:50:08 +0000 (17:50 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 5 Jul 2022 15:09:35 +0000 (15:09 +0000)
This adds the feature of the 'hostname' algorithm,
but provides it for all algorithms, including 'next_module'.

This can be used to deliberately break lock coherency, but
keep the devid/inode pair untouched, as this will only
alter file_id.extid:

  vfs objects = fileid
  fileid:algorithm = next_module
  fileid:nolock_all_inodes = yes

This should be preferred unless someone is already using the
'hostname' algorithm.

Note this is only for testing (or read only shares if at all...)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_fileid.c

index c6d25efe97b844106b1693c453540aa3120fc067..2c67946efb3fdb52dbffd08581c9d70c96c8293f 100644 (file)
@@ -577,6 +577,9 @@ static int fileid_connect(struct vfs_handle_struct *handle,
                }
        }
 
+       data->nolock.force_all_inodes = lp_parm_bool(SNUM(handle->conn),
+                                                    "fileid", "nolock_all_inodes",
+                                                    data->nolock.force_all_inodes);
        data->nolock.force_all_dirs = lp_parm_bool(SNUM(handle->conn),
                                                   "fileid", "nolock_all_dirs",
                                                   data->nolock.force_all_dirs);