applied HDFS-6411.004.patch from apache JIRA board