Fix another osxfuse request ID reuse bug.

geesefs-0-30-9
Aaron Jacobs 2015-05-05 11:47:05 +10:00
parent 7fd0abb1f5
commit 0c8f9cece8
3 changed files with 6 additions and 4 deletions

View File

@ -140,7 +140,9 @@ func (c *Connection) beginOp(
}
// Clean up all state associated with an op to which the user has responded,
// given its underlying bazilfuse request.
// given its underlying bazilfuse request. This must be called before a
// response is sent to the kernel, to avoid a race where the request's ID might
// be reused by osxfuse.
//
// LOCKS_EXCLUDED(c.mu)
func (c *Connection) finishOp(bfReq bazilfuse.Request) {

View File

@ -208,8 +208,8 @@ func (o *commonOp) Logf(format string, v ...interface{}) {
}
func (o *commonOp) Respond(err error) {
// Don't forget to report back to the connection that we are finished.
defer o.finished(err)
// Report that the user is responding.
o.finished(err)
// If successful, we should respond to bazilfuse with the appropriate struct.
if err == nil {

View File

@ -27,7 +27,7 @@ import (
//
// Convert the supplied bazilfuse request struct to an Op. finished will be
// called with the error supplied to o.Respond when the user invokes that
// method.
// method, before a response is sent to the kernel.
//
// It is guaranteed that o != nil. If the op is unknown, a special unexported
// type will be used.