fix(metanode): hybrid cloud check sortedEks is nil when excute fsmAppendExtentsWithCheck

Signed-off-by: chihe <chi.he@oppo.com>
This commit is contained in:
chihe 2023-12-13 23:03:19 -08:00 committed by AmazingChi
parent 0bc93129de
commit f637d0cc19

View File

@ -487,10 +487,10 @@ func (mp *metaPartition) fsmAppendExtentsWithCheck(ino *Inode, isSplit bool) (st
if len(ino.Extents.eks) != 0 {
isCache = true
eks = ino.Extents.CopyExtents()
} else if len(ino.HybridCouldExtents.sortedEks.(*SortedExtents).eks) != 0 {
} else if ino.HybridCouldExtents.sortedEks != nil && len(ino.HybridCouldExtents.sortedEks.(*SortedExtents).eks) != 0 {
isCache = false
eks = ino.HybridCouldExtents.sortedEks.(*SortedExtents).CopyExtents()
} else {
} else if ino.HybridCouldExtentsMigration.sortedEks != nil && len(ino.HybridCouldExtentsMigration.sortedEks.(*SortedExtents).eks) != 0 {
isMigration = true
eks = ino.HybridCouldExtentsMigration.sortedEks.(*SortedExtents).CopyExtents()
}