Porting local/upstreams's 9e0cab902253506c7089a52a832b649677cfdef5