Commit fd7328fa authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse: ignore unrecognized opcodes

Go-FUSE has been trailing the kernel, and the kernel (usually) is
careful to only send opcodes that are recognized. However, on GKE
(GCP) the undefined opcode 2016 has been seen, leading to a crash.

Fixes #276.
parent 161a1648
...@@ -217,8 +217,14 @@ func (r *request) outData() unsafe.Pointer { ...@@ -217,8 +217,14 @@ func (r *request) outData() unsafe.Pointer {
// serializeHeader serializes the response header. The header points // serializeHeader serializes the response header. The header points
// to an internal buffer of the receiver. // to an internal buffer of the receiver.
func (r *request) serializeHeader(flatDataSize int) (header []byte) { func (r *request) serializeHeader(flatDataSize int) (header []byte) {
dataLength := r.handler.OutputSize var dataLength uintptr
if r.handler != nil {
dataLength = r.handler.OutputSize
}
if r.status > OK { if r.status > OK {
// only do this for positive status; negative status
// is used for notification.
dataLength = 0 dataLength = 0
} }
......
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