slfan1989 commented on code in PR #8932:
URL: https://github.com/apache/hadoop/pull/8932#discussion_r4504640732


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/RawLocalFileSystem.java:
##########
@@ -1330,7 +1330,7 @@ private FileStatus getFileLinkStatusInternal(final Path f,
   @Deprecated
   private FileStatus deprecatedGetFileLinkStatusInternal(final Path f)
       throws IOException {
-    String target = FileUtil.readLink(new File(f.toString()));
+    String target = FileUtil.readLink(pathToFile(f));

Review Comment:
   Could we also qualify the link path stored in the returned `FileStatus`? 
   
   With the filesystem working directory set to a temp directory containing 
`link -> target`, I reproduced an `IllegalArgumentException` from 
`getFileLinkStatus(new Path("link"))`.
   
   `pathToFile(f)` finds the link, but the status still carries the relative 
path link, so qualifying the relative target fails. 
   
   Could we use `makeQualified(f)` in both symlink return paths and add a 
regression test?



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

Reply via email to