From f637d0cc199a13bc9c32ea6f656aa8cd61063b49 Mon Sep 17 00:00:00 2001 From: chihe Date: Wed, 13 Dec 2023 23:03:19 -0800 Subject: [PATCH] fix(metanode): hybrid cloud check sortedEks is nil when excute fsmAppendExtentsWithCheck Signed-off-by: chihe --- metanode/partition_fsmop_inode.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metanode/partition_fsmop_inode.go b/metanode/partition_fsmop_inode.go index 383cb2d8e..1ea3f0bb1 100644 --- a/metanode/partition_fsmop_inode.go +++ b/metanode/partition_fsmop_inode.go @@ -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() }