HDFS-4679. Namenode operation checks should be done in a consistent manner. Contributed by Suresh Srinivas.