zhuxiangyi commented on code in PR #2964:
URL: https://github.com/apache/hadoop/pull/2964#discussion_r1328786375
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java:
##########
@@ -1468,6 +1475,30 @@ static Collection<String>
normalizePaths(Collection<String> paths,
return normalized;
}
+ /**
+ * Get the first Node that sets Quota.
+ */
+ static INode getFirstSetQuotaParentNode(INodesInPath iip) {
+ for (int i = iip.length() - 1; i > 0; i--) {
+ INode currNode = iip.getINode(i);
+ if (currNode == null) {
Review Comment:
Here we need to keep check
In some cases the last inode of iip is empty.
for example:
If the file /a/b/c does not exist, I perform a rename operation to mv
/a/b/c1 to /a/b/c.
In this case, dstIIP will be repopulated through the dstForRenameTo method,
and the last inode that does not exist will be null.
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirMkdirOp.java:
##########
@@ -221,8 +221,8 @@ private static INodesInPath unprotectedMkdir(FSDirectory
fsd, long inodeId,
final INodeDirectory dir = new INodeDirectory(inodeId, name, permission,
timestamp);
- INodesInPath iip =
- fsd.addLastINode(parent, dir, permission.getPermission(), true);
+ INodesInPath iip = fsd.addLastINode(parent, dir,
+ permission.getPermission(), true, null, true);
Review Comment:
ok
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]