diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-10-09 00:02:50 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-10-09 00:02:50 -0700 |
| commit | 09874f0d16f60cec9cbce0108c4efa2c40d4786c (patch) | |
| tree | e15bd953c6c5a812e72e60476ca7d1c6985c543a /weed/storage/volume_loading.go | |
| parent | a999ed94d0abe53ac444c6a12cf0f5f89ea06d33 (diff) | |
| download | seaweedfs-09874f0d16f60cec9cbce0108c4efa2c40d4786c.tar.xz seaweedfs-09874f0d16f60cec9cbce0108c4efa2c40d4786c.zip | |
volume: return error if superblock is not initialized
fix https://github.com/chrislusf/seaweedfs/issues/1079
Diffstat (limited to 'weed/storage/volume_loading.go')
| -rw-r--r-- | weed/storage/volume_loading.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/weed/storage/volume_loading.go b/weed/storage/volume_loading.go index 0b6021ca8..19a45c842 100644 --- a/weed/storage/volume_loading.go +++ b/weed/storage/volume_loading.go @@ -59,6 +59,9 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind if alreadyHasSuperBlock { e = v.readSuperBlock() } else { + if !v.SuperBlock.Initialized() { + return fmt.Errorf("volume %s.dat not initialized", fileName) + } e = v.maybeWriteSuperBlock() } if e == nil && alsoLoadIndex { |
