fix for HADOOP-8655 backported