Commit 13019c9b authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Don't fail in grow() if the pair is big enough.

parent 01d1fc58
......@@ -423,7 +423,7 @@ func (ms *MountState) TrySplice(header []byte, req *request, fdData *ReadResultF
_, err = pair.WriteTo(ms.mountFile.Fd(), total)
if err != nil {
return fmt.Errorf("splice write: %v", err)
return err
}
return nil
}
......
......@@ -17,15 +17,15 @@ func (p *Pair) MaxGrow() {
}
func (p *Pair) Grow(n int) bool {
if n <= p.size {
return true
}
if !resizable {
return false
}
if n > maxPipeSize {
return false
}
if n <= p.size {
return true
}
newsize, errNo := fcntl(p.r.Fd(), F_SETPIPE_SZ, n)
if errNo != 0 {
......@@ -85,7 +85,7 @@ func (p *Pair) LoadFrom(fd uintptr, sz int) (int, error) {
func (p *Pair) WriteTo(fd uintptr, n int) (int, error) {
m, err := syscall.Splice(int(p.r.Fd()), nil, int(fd), nil, int(n), 0)
if err != nil {
err = os.NewSyscallError("Splice write to: ", err)
err = os.NewSyscallError("Splice write", err)
}
return int(m), err
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment