upstream commit 1bb122bcd82bcd308ffbf3a86084ae02841ac73b