upstream commit f46e6d9cb9a6bf419fe2a428a8a586239e93aa2d