[ 
https://issues.apache.org/jira/browse/HDFS-2436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13138301#comment-13138301
 ] 

Uma Maheswara Rao G commented on HDFS-2436:
-------------------------------------------

{quote}
Arpit also found that there is a NPE if calling getFileChecksum(..) with a 
directory.
{quote}
 This is because, getBlockLoactions will return null on dirs
{code}
 private synchronized LocatedBlocks getBlockLocationsInternal(String src,
                                                       long offset, 
                                                       long length,
                                                       int nrBlocksToReturn,
                                                       boolean doAccessTime, 
                                                       boolean needBlockToken)
                                                       throws IOException {
    INodeFile inode = dir.getFileINode(src);
    if(inode == null) {
      return null;
    }
{code}

Above code snippet is from 20Security branch.


Looks this is already handled in trunk code

{code}
 INodeFile inode = dir.getFileINode(src);
        if (inode == null) {
          throw new FileNotFoundException("File does not exist: " + src);
        }
{code}

I just verified in trunk, i did not find the null pointer exception. It throws 
FileNotFoundException.

20Security is throwing the NullPointerException. 

I am palnning to sync the behaviors with trunk! And will file separate JIRA for 
that.


Thanks,
Uma
 
                
> FSNamesystem.setTimes(..) expects the path is a file.
> -----------------------------------------------------
>
>                 Key: HDFS-2436
>                 URL: https://issues.apache.org/jira/browse/HDFS-2436
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 0.20.205.0
>            Reporter: Arpit Gupta
>            Assignee: Uma Maheswara Rao G
>         Attachments: HDFS-2436.patch
>
>
> FSNamesystem.setTimes(..) does not work if the path is a directory.
> Arpit found this bug when testing webhdfs:
> {quote}
> settimes api is working when called on a file, but when called on a dir it 
> returns a 404. I should be able to set time on both a file and a directory.
> {quote}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to