There is an merge request which solves the issue: https://gitlab.com/samba-team/samba/merge_requests/541
I've updated the merge request and added the "BUG: " line on the related patches.
This is fixed in 4.11 with commit 64e37e3822afbed2f5b97b8d456108cc79bd99bc