[ 
https://issues.apache.org/jira/browse/HDFS-11476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jing Zhao updated HDFS-11476:
-----------------------------
          Resolution: Fixed
        Hadoop Flags: Reviewed
       Fix Version/s: 2.9.0
    Target Version/s:   (was: 2.8.0)
              Status: Resolved  (was: Patch Available)

I've committed this to trunk and branch-2.  Thanks [~xiaobingo] for the fix! 
Thanks [~arpitagarwal] and [~liuml07] for the review.

> Fix NPE in FsDatasetImpl#checkAndUpdate
> ---------------------------------------
>
>                 Key: HDFS-11476
>                 URL: https://issues.apache.org/jira/browse/HDFS-11476
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: datanode
>            Reporter: Xiaobing Zhou
>            Assignee: Xiaobing Zhou
>             Fix For: 2.9.0
>
>         Attachments: HDFS-11476.000.patch, HDFS-11476.001.patch, 
> HDFS-11476.002.patch, HDFS-11476.003.patch
>
>
> diskMetaFile can be null and passed to compareTo which dereferences it, 
> causing NPE
> {code}
> // Compare generation stamp
>       if (memBlockInfo.getGenerationStamp() != diskGS) {
>         File memMetaFile = FsDatasetUtil.getMetaFile(diskFile, 
>             memBlockInfo.getGenerationStamp());
>         if (memMetaFile.exists()) {
>           if (memMetaFile.compareTo(diskMetaFile) != 0) {
>             LOG.warn("Metadata file in memory "
>                 + memMetaFile.getAbsolutePath()
>                 + " does not match file found by scan "
>                 + (diskMetaFile == null? null: 
> diskMetaFile.getAbsolutePath()));
>           }
>         } else {
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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

Reply via email to