Don't send error responses to the kernel for forget and interrupt.
It's not expecting them.geesefs-0-30-9
parent
d205df3144
commit
1e2d4abaf9
|
@ -423,6 +423,18 @@ func (c *Connection) kernelResponse(
|
||||||
h := m.OutHeader()
|
h := m.OutHeader()
|
||||||
h.Unique = fuseID
|
h.Unique = fuseID
|
||||||
|
|
||||||
|
// Special case: handle the ops for which the kernel expects no response.
|
||||||
|
// interruptOp .
|
||||||
|
switch op.(type) {
|
||||||
|
case *fuseops.ForgetInodeOp:
|
||||||
|
noResponse = true
|
||||||
|
return
|
||||||
|
|
||||||
|
case *interruptOp:
|
||||||
|
noResponse = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// If the user returned the error, fill in the error field of the outgoing
|
// If the user returned the error, fill in the error field of the outgoing
|
||||||
// message header.
|
// message header.
|
||||||
if opErr != nil {
|
if opErr != nil {
|
||||||
|
@ -441,7 +453,7 @@ func (c *Connection) kernelResponse(
|
||||||
|
|
||||||
// Otherwise, fill in the rest of the response.
|
// Otherwise, fill in the rest of the response.
|
||||||
if opErr == nil {
|
if opErr == nil {
|
||||||
noResponse = c.kernelResponseForOp(m, op)
|
c.kernelResponseForOp(m, op)
|
||||||
}
|
}
|
||||||
|
|
||||||
h.Len = uint32(m.Len())
|
h.Len = uint32(m.Len())
|
||||||
|
@ -452,7 +464,7 @@ func (c *Connection) kernelResponse(
|
||||||
// op.
|
// op.
|
||||||
func (c *Connection) kernelResponseForOp(
|
func (c *Connection) kernelResponseForOp(
|
||||||
m *buffer.OutMessage,
|
m *buffer.OutMessage,
|
||||||
op interface{}) (noResponse bool) {
|
op interface{}) {
|
||||||
// Create the appropriate output message
|
// Create the appropriate output message
|
||||||
switch o := op.(type) {
|
switch o := op.(type) {
|
||||||
case *fuseops.LookUpInodeOp:
|
case *fuseops.LookUpInodeOp:
|
||||||
|
@ -474,9 +486,6 @@ func (c *Connection) kernelResponseForOp(
|
||||||
o.AttributesExpiration)
|
o.AttributesExpiration)
|
||||||
convertAttributes(o.Inode, &o.Attributes, &out.Attr)
|
convertAttributes(o.Inode, &o.Attributes, &out.Attr)
|
||||||
|
|
||||||
case *fuseops.ForgetInodeOp:
|
|
||||||
noResponse = true
|
|
||||||
|
|
||||||
case *fuseops.MkDirOp:
|
case *fuseops.MkDirOp:
|
||||||
size := fusekernel.EntryOutSize(c.protocol)
|
size := fusekernel.EntryOutSize(c.protocol)
|
||||||
out := (*fusekernel.EntryOut)(m.Grow(size))
|
out := (*fusekernel.EntryOut)(m.Grow(size))
|
||||||
|
@ -551,9 +560,6 @@ func (c *Connection) kernelResponseForOp(
|
||||||
case *statFSOp:
|
case *statFSOp:
|
||||||
m.Grow(unsafe.Sizeof(fusekernel.StatfsOut{}))
|
m.Grow(unsafe.Sizeof(fusekernel.StatfsOut{}))
|
||||||
|
|
||||||
case *interruptOp:
|
|
||||||
noResponse = true
|
|
||||||
|
|
||||||
case *initOp:
|
case *initOp:
|
||||||
out := (*fusekernel.InitOut)(m.Grow(unsafe.Sizeof(fusekernel.InitOut{})))
|
out := (*fusekernel.InitOut)(m.Grow(unsafe.Sizeof(fusekernel.InitOut{})))
|
||||||
|
|
||||||
|
@ -564,7 +570,7 @@ func (c *Connection) kernelResponseForOp(
|
||||||
out.MaxWrite = o.MaxWrite
|
out.MaxWrite = o.MaxWrite
|
||||||
|
|
||||||
default:
|
default:
|
||||||
panic(fmt.Sprintf("Unknown op: %#v", op))
|
panic(fmt.Sprintf("Unexpected op: %#v", op))
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue