upstream commit 680ac9312d9a0635a4ae877462f8e179c6fe211b