sync with upstream 54a6bf9df