aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/filehandle.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-09-07 13:11:43 -0700
committerChris Lu <chris.lu@gmail.com>2018-09-07 13:11:43 -0700
commit75e749039ba3ae441281266d7eb6abeb07c161bd (patch)
tree9878b2800b36cb6aadc657ad158fff2a12de584b /weed/filesys/filehandle.go
parent43ff60cb23938ee36aa2fecbaba02c5040184ef5 (diff)
downloadseaweedfs-75e749039ba3ae441281266d7eb6abeb07c161bd.tar.xz
seaweedfs-75e749039ba3ae441281266d7eb6abeb07c161bd.zip
fix data writes error when consecutive calls overlaps with previous writes
Diffstat (limited to 'weed/filesys/filehandle.go')
-rw-r--r--weed/filesys/filehandle.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go
index 0c13db984..192bf6d52 100644
--- a/weed/filesys/filehandle.go
+++ b/weed/filesys/filehandle.go
@@ -140,6 +140,7 @@ func (fh *FileHandle) Write(ctx context.Context, req *fuse.WriteRequest, resp *f
chunks, err := fh.dirtyPages.AddPage(ctx, req.Offset, req.Data)
if err != nil {
+ glog.Errorf("%+v/%v write fh %d: [%d,%d): %v", fh.f.dir.Path, fh.f.Name, fh.handle, req.Offset, req.Offset+int64(len(req.Data)), err)
return fmt.Errorf("write %s/%s at [%d,%d): %v", fh.f.dir.Path, fh.f.Name, req.Offset, req.Offset+int64(len(req.Data)), err)
}
@@ -179,7 +180,7 @@ func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error {
chunk, err := fh.dirtyPages.FlushToStorage(ctx)
if err != nil {
- glog.V(0).Infof("flush %s/%s to %s [%d,%d): %v", fh.f.dir.Path, fh.f.Name, chunk.FileId, chunk.Offset, chunk.Offset+int64(chunk.Size), err)
+ glog.Errorf("flush %s/%s to %s [%d,%d): %v", fh.f.dir.Path, fh.f.Name, chunk.FileId, chunk.Offset, chunk.Offset+int64(chunk.Size), err)
return fmt.Errorf("flush %s/%s to %s [%d,%d): %v", fh.f.dir.Path, fh.f.Name, chunk.FileId, chunk.Offset, chunk.Offset+int64(chunk.Size), err)
}
if chunk != nil {