Browse Source

add lock on dirty pages

pull/1189/head
Chris Lu 5 years ago
parent
commit
72e1aff237
  1. 4
      weed/filesys/dirty_page.go

4
weed/filesys/dirty_page.go

@ -231,6 +231,10 @@ func min(x, y int64) int64 {
func (pages *ContinuousDirtyPages) ReadDirtyData(ctx context.Context, data []byte, startOffset int64) (offset int64, size int, err error) {
bufSize := int64(len(data))
pages.lock.Lock()
defer pages.lock.Unlock()
if startOffset+bufSize < pages.Offset {
return
}

Loading…
Cancel
Save