summaryrefslogtreecommitdiffhomepage
path: root/pkg/p9/transport_flipcall.go
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2019-10-04 14:55:11 -0700
committergVisor bot <gvisor-bot@google.com>2019-10-04 14:56:53 -0700
commitb941e357615a7b0e04dbf6535cafacfbb4b7e276 (patch)
tree318b3d33da5ea71491b4a514b9f0296f93fe86b8 /pkg/p9/transport_flipcall.go
parent7ef1c44a7fe027d60c92b44515655a612d40d034 (diff)
Return EIO from p9 if flipcall.Endpoint.Connect() fails.
Also ensure that all flipcall transport errors not returned by p9 (converted to EIO by the client, or dropped on the floor by channel server goroutines) are logged. PiperOrigin-RevId: 272963663
Diffstat (limited to 'pkg/p9/transport_flipcall.go')
-rw-r--r--pkg/p9/transport_flipcall.go24
1 files changed, 2 insertions, 22 deletions
diff --git a/pkg/p9/transport_flipcall.go b/pkg/p9/transport_flipcall.go
index 7cdf4ecc3..233f825e3 100644
--- a/pkg/p9/transport_flipcall.go
+++ b/pkg/p9/transport_flipcall.go
@@ -132,7 +132,7 @@ func (ch *channel) send(m message) (uint32, error) {
if filer, ok := m.(filer); ok {
if f := filer.FilePayload(); f != nil {
if err := ch.fds.SendFD(f.FD()); err != nil {
- return 0, syscall.EIO // Map everything to EIO.
+ return 0, err
}
f.Close() // Per sendRecvLegacy.
sentFD = true // To mark below.
@@ -162,15 +162,7 @@ func (ch *channel) send(m message) (uint32, error) {
}
// Perform the one-shot communication.
- n, err := ch.data.SendRecv(ssz)
- if err != nil {
- if n > 0 {
- return n, nil
- }
- return 0, syscall.EIO // See above.
- }
-
- return n, nil
+ return ch.data.SendRecv(ssz)
}
// recv decodes a message that exists on the channel.
@@ -249,15 +241,3 @@ func (ch *channel) recv(r message, rsz uint32) (message, error) {
return r, nil
}
-
-// sendRecv sends the given message over the channel.
-//
-// This is used by the client.
-func (ch *channel) sendRecv(c *Client, m, r message) error {
- rsz, err := ch.send(m)
- if err != nil {
- return err
- }
- _, err = ch.recv(r, rsz)
- return err
-}