upstream commit a54afb6fe333cd1ae72170d2a452ae94d428b9c7