upstream commit bec4bd0f70aa46f55a980996e8774547c0f909c8