HDFS-12487. FsDatasetSpi.isValidBlock() lacks null pointer check inside and neither do the callers. Contributed by liumi.
This commit is contained in:
parent
371452e260
commit
1524e2e6c5
@ -905,6 +905,11 @@ private ExtendedBlock getBlockToCopy(FsVolumeSpi.BlockIterator iter,
|
|||||||
while (!iter.atEnd() && item.getErrorCount() < getMaxError(item)) {
|
while (!iter.atEnd() && item.getErrorCount() < getMaxError(item)) {
|
||||||
try {
|
try {
|
||||||
ExtendedBlock block = iter.nextBlock();
|
ExtendedBlock block = iter.nextBlock();
|
||||||
|
if(null == block){
|
||||||
|
LOG.info("NextBlock call returned null.No valid block to copy. {}",
|
||||||
|
item.toJson());
|
||||||
|
return block;
|
||||||
|
}
|
||||||
|
|
||||||
if (block != null) {
|
if (block != null) {
|
||||||
// A valid block is a finalized block, we iterate until we get
|
// A valid block is a finalized block, we iterate until we get
|
||||||
|
Loading…
Reference in New Issue
Block a user