Browse Source

super block reserves a couple of bits for future extension

pull/695/head
Chris Lu 7 years ago
parent
commit
7f6500ae07
  1. 5
      weed/storage/volume_super_block.go

5
weed/storage/volume_super_block.go

@ -55,8 +55,9 @@ func (s *SuperBlock) Bytes() []byte {
glog.Fatalf("cannot marshal super block extra %+v: %v", s.Extra, err) glog.Fatalf("cannot marshal super block extra %+v: %v", s.Extra, err)
} }
extraSize := len(extraData) extraSize := len(extraData)
if extraSize > 256*256 {
glog.Fatalf("super block extra size is %d bigger than %d: %v", extraSize, 256*256)
if extraSize > 256*256-2 {
// reserve a couple of bits for future extension
glog.Fatalf("super block extra size is %d bigger than %d: %v", extraSize, 256*256-2)
} }
s.extraSize = uint16(extraSize) s.extraSize = uint16(extraSize)
util.Uint16toBytes(header[6:8], s.extraSize) util.Uint16toBytes(header[6:8], s.extraSize)

Loading…
Cancel
Save