hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arpit Agarwal (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-11476) Fix NPE in FsDatasetImpl#checkAndUpdate
Date Wed, 01 Mar 2017 05:18:45 GMT

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

Arpit Agarwal commented on HDFS-11476:
--------------------------------------

+1 for the patch. Thanks for fixing this.

[~xiaobingo], while you are changing this line, could you please replace the memMetaFile.exists()
check with a call to fileIoProvider.exists()?

> 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
>         Attachments: HDFS-11476.000.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: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org


Mime
View raw message