upstream commit f230d5b8bc08b4254b117d80a219784909f9692a