I won't have the time to dedicate this in the next few days and the attempt at a patch backport already took 1+ hour, alas. This reverts commit 85f7ac75.