From c278bac26388bb35030e87562bc91a13290ec68e Mon Sep 17 00:00:00 2001 From: chrislu Date: Fri, 7 Jul 2023 22:16:58 -0700 Subject: [PATCH] avoid nil needle map fix https://github.com/seaweedfs/seaweedfs/issues/4640 --- weed/storage/volume_write.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/weed/storage/volume_write.go b/weed/storage/volume_write.go index ae607e691..56010cea2 100644 --- a/weed/storage/volume_write.go +++ b/weed/storage/volume_write.go @@ -197,6 +197,10 @@ func (v *Volume) syncDelete(n *needle.Needle) (Size, error) { v.dataFileAccessLock.Lock() defer v.dataFileAccessLock.Unlock() + if v.nm == nil { + return 0, nil + } + if MaxPossibleVolumeSize < v.nm.ContentSize()+uint64(actualSize) { err := fmt.Errorf("volume size limit %d exceeded! current size is %d", MaxPossibleVolumeSize, v.nm.ContentSize()) return 0, err