diff --git a/go/storage/volume.go b/go/storage/volume.go index b7b492b9d..33c77a38f 100644 --- a/go/storage/volume.go +++ b/go/storage/volume.go @@ -87,12 +87,14 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind } } - if v.version == NoneVersion { - e = v.readSuperBlock() - } else { - e = v.maybeWriteSuperBlock() + if e = v.maybeWriteSuperBlock(); e != nil { + return e + } + if e = v.readSuperBlock(); e != nil { + return e } - if e == nil && alsoLoadIndex { + + if alsoLoadIndex { var indexFile *os.File if v.readOnly { glog.V(1).Infoln("open to read file", fileName+".idx")