This should get picked to stable.
/cc @rspeicher @grzesiek
Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/4296