> will need extensive testing...
Currently TestHDFSCLI, TestQuota and the new test cases added add to a lot of testcases. Let me know if you feel any thing more specific is needed. Also FSDirectory.verifyQuota() is mostly refactored code out of FSDirectory.updateCount().
> Check the value returned by getExistingPathINodes(), compare it with the number of path components.
This is what current checks for dstInodes[dstInodes.length-1] != null and dstInodes[dstInodes.length-2] == null does. If you feel it is still good to add additional check for return value, I can add it.
> you addChild() with inheritPermission == true. In the old code it was false. Is that intentional?
That was not intentional. Thanks for catching it.
Attaching new patch with incorporated comments.