applying manual patch of HDFS-5804
Merge pull request #1 from gerlachry/HDFS-5804

applying manual patch of HDFS-5804