upstream commit 1d21cfbe047026aae2a2330b5e9f545095d1d1ea