mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
avoid nil needle map
fix https://github.com/seaweedfs/seaweedfs/issues/4640
This commit is contained in:
parent
0606b59a3e
commit
c278bac263
|
@ -197,6 +197,10 @@ func (v *Volume) syncDelete(n *needle.Needle) (Size, error) {
|
||||||
v.dataFileAccessLock.Lock()
|
v.dataFileAccessLock.Lock()
|
||||||
defer v.dataFileAccessLock.Unlock()
|
defer v.dataFileAccessLock.Unlock()
|
||||||
|
|
||||||
|
if v.nm == nil {
|
||||||
|
return 0, nil
|
||||||
|
}
|
||||||
|
|
||||||
if MaxPossibleVolumeSize < v.nm.ContentSize()+uint64(actualSize) {
|
if MaxPossibleVolumeSize < v.nm.ContentSize()+uint64(actualSize) {
|
||||||
err := fmt.Errorf("volume size limit %d exceeded! current size is %d", MaxPossibleVolumeSize, v.nm.ContentSize())
|
err := fmt.Errorf("volume size limit %d exceeded! current size is %d", MaxPossibleVolumeSize, v.nm.ContentSize())
|
||||||
return 0, err
|
return 0, err
|
||||||
|
|
Loading…
Reference in a new issue