upstream commit c41f9b674ddd6d0308e969dfd66b8822c5918189