fusefrontend: doWrite: report readFileID errors as I/O error
It used to be reported as "function not implemented", accompanied with this log output: go-fuse: can't convert error type: ParseHeader: header is all-zero. Header hexdump: 000000000000000000000000000000000000 Now we report EIO and log this: doWrite 1372183: corrupt header: ParseHeader: header is all-zero. Header hexdump: 000000000000000000000000000000000000
This commit is contained in:
parent
e9a5b8962b
commit
85297cda97
@ -273,6 +273,10 @@ func (f *File) doWrite(data []byte, off int64) (uint32, syscall.Errno) {
|
|||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
fileID, err = f.createHeader()
|
fileID, err = f.createHeader()
|
||||||
fileWasEmpty = true
|
fileWasEmpty = true
|
||||||
|
} else if err != nil {
|
||||||
|
// Other errors mean readFileID() found a corrupt header
|
||||||
|
tlog.Warn.Printf("doWrite %d: corrupt header: %v", f.qIno.Ino, err)
|
||||||
|
return 0, syscall.EIO
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, fs.ToErrno(err)
|
return 0, fs.ToErrno(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user