umamaheswararao commented on pull request #2305:
URL: https://github.com/apache/hadoop/pull/2305#issuecomment-692781129


   @ayushtkn Thanks a lot for the review!
   
   >Just want to confirm, In rename, do we need to avoid any scenario like 
HDFS-15444? Or that is guarded already.
   
   I actually considered that case, the first time is without last component. 
If that resolve result indicates it as InternalDir, then we are again resolving 
with including lastComponent ( means with children ).  In this case if it again 
indicates internalDir or lastDirAsLink, then we are throwing exception as we 
can not rename to any internal dir/link path.
   
   
    ```
      InodeTree.ResolveResult<FileSystem> resDst =
           fsState.resolve(getUriPath(dst), false);
   
       if (resDst.isInternalDir() && fsState.getRootFallbackLink() != null) {
         InodeTree.ResolveResult<FileSystem> resDstWithLastComp =
             fsState.resolve(getUriPath(dst), true);
         // resolveLastComponent with true is to check if the target already
         // exist in internalDir/InternalDirLink itself.
         if (resDstWithLastComp.isInternalDir() || resDstWithLastComp
             .isLastInternalDirLink()) {
           throw readOnlyMountTable("rename", dst);
   ```
   
   There is one condition without fallback, we may attempt to rename. Probably 
we need else, as we are combining if check with fsState.getRootFallbackLink() 
!= null as well. I will update patch. Thanks 


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to