[PATCH] improve performance for samba-tool ntacl sysvolreset

joeg at catalyst.net.nz joeg at catalyst.net.nz
Fri Jul 6 03:12:58 UTC 2018


Hi all:

I created a patch to improve the performance for samba-tool ntacl
sysvolreset cmd.

The `sysvolreset` cmd was slow with large amount of files.

With perf tool, we figure out the bottle neck is in
`user_sid_in_group_sid` which is trying to create user token from sid
all the time while we call `setntacl`.

To avoid that, we pass a `session_info` parameter all the way down to
the related functions, which has the `security_token` with it. And then
in `smbd/posix_acls.c:uid_entry_in_group`, we check with the
security_token if exist.

In our testenv, with 2k files, time for sysvolreset cmd decrease from
about 155s to 80s.

A Merge Request is also created on GitLab:

https://gitlab.com/samba-team/samba/merge_requests/17

Review appreciated!

-- 
Joe Guo
joeg at catalyst.net.nz
Catalyst IT

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sysvolreset.patch
Type: text/x-patch
Size: 59308 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20180706/9e6e856a/sysvolreset-0001.bin>


More information about the samba-technical mailing list