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

fuse: do not print warning for ENOENT on RELEASE

This avoids spurious error messages when unmounting a file system
directly after closing a file.

Fixes #505

Change-Id: I3a6a6ada0b5e5abe95a1d7965a48ddb46664310a
parent 36b35911
......@@ -529,15 +529,22 @@ func (ms *Server) handleRequest(req *request) Status {
errNo := ms.write(req)
if errNo != 0 {
// Unless debugging is enabled, ignore ENOENT for INTERRUPT responses
// which indicates that the referred request is no longer known by the
// kernel. This is a normal if the referred request already has
// completed.
if ms.opts.Debug || !(req.inHeader.Opcode == _OP_INTERRUPT && errNo == ENOENT) {
// Ignore ENOENT for INTERRUPT responses which
// indicates that the referred request is no longer
// known by the kernel. This is a normal if the
// referred request already has completed.
//
// Ignore ENOENT for RELEASE responses. When the FS
// is unmounted directly after a file close, the
// device can go away while we are still processing
// RELEASE. This is because RELEASE is analogous to
// FORGET, and is not synchronized with the calling
// process, but does require a response.
if ms.opts.Debug || !(errNo == ENOENT && (req.inHeader.Opcode == _OP_INTERRUPT ||
req.inHeader.Opcode == _OP_RELEASE)) {
ms.opts.Logger.Printf("writer: Write/Writev failed, err: %v. opcode: %v",
errNo, operationName(req.inHeader.Opcode))
}
}
ms.returnRequest(req)
return Status(errNo)
......
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