diff --git a/pfsagentd/io.go b/pfsagentd/io.go index 230000437..b5fef3d1b 100644 --- a/pfsagentd/io.go +++ b/pfsagentd/io.go @@ -1282,7 +1282,7 @@ func (chunkedPutContext *chunkedPutContextStruct) getReadPlanHelper(fileOffset u fileOffset: curFileOffset, objectOffset: inReadPlanStepAsSingleObjectExtent.objectOffset + (curFileOffset - inReadPlanStepAsSingleObjectExtent.fileOffset), length: overlapExtentWithLink.fileOffset - curFileOffset, - chunkedPutContext: chunkedPutContext, + chunkedPutContext: inReadPlanStepAsSingleObjectExtent.chunkedPutContext, } outReadPlan = append(outReadPlan, outReadPlanStepAsSingleObjectExtent) @@ -1318,7 +1318,7 @@ func (chunkedPutContext *chunkedPutContextStruct) getReadPlanHelper(fileOffset u fileOffset: curFileOffset, objectOffset: inReadPlanStepAsSingleObjectExtent.objectOffset + (curFileOffset - inReadPlanStepAsSingleObjectExtent.fileOffset), length: remainingLength, - chunkedPutContext: chunkedPutContext, + chunkedPutContext: inReadPlanStepAsSingleObjectExtent.chunkedPutContext, } outReadPlan = append(outReadPlan, outReadPlanStepAsSingleObjectExtent) @@ -1864,6 +1864,12 @@ func pruneExtentMap(extentMap sortedmap.LLRBTree, newSize uint64) { ok bool ) + // Nothing to do if extentMap hasn't been populated yet + + if nil == extentMap { + return + } + // First, destroy any extents starting at or beyond newSize index, _, err = extentMap.BisectRight(newSize)