aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys
diff options
context:
space:
mode:
Diffstat (limited to 'weed/filesys')
-rw-r--r--weed/filesys/filehandle.go5
-rw-r--r--weed/filesys/wfs.go1
2 files changed, 6 insertions, 0 deletions
diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go
index 372d742ea..c6637259d 100644
--- a/weed/filesys/filehandle.go
+++ b/weed/filesys/filehandle.go
@@ -3,6 +3,7 @@ package filesys
import (
"context"
"fmt"
+ "io"
"math"
"net/http"
"time"
@@ -98,6 +99,10 @@ func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, error) {
totalRead, err := fh.f.reader.ReadAt(buff, offset)
+ if err == io.EOF {
+ err = nil
+ }
+
if err != nil {
glog.Errorf("file handle read %s: %v", fh.f.fullpath(), err)
}
diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go
index 67dd2a62c..2b0ef64c2 100644
--- a/weed/filesys/wfs.go
+++ b/weed/filesys/wfs.go
@@ -89,6 +89,7 @@ func NewSeaweedFileSystem(option *Option) *WFS {
},
}
if option.CacheSizeMB > 0 {
+ os.MkdirAll(option.CacheDir, 0755)
wfs.chunkCache = chunk_cache.NewChunkCache(256, option.CacheDir, option.CacheSizeMB)
grace.OnInterrupt(func() {
wfs.chunkCache.Shutdown()