Add more logs for writing failures.
Bug: 62429763 Test: libappfuse_test Change-Id: Ie0eabd09ae9ad3f8ba8c4f38f871dad16b5c58ff
This commit is contained in:
parent
435baf5d00
commit
e5a1556d40
2 changed files with 17 additions and 1 deletions
|
@ -57,6 +57,12 @@ void GetObservedEvents(FuseBridgeState state, int* device_events, int* proxy_eve
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void LogResponseError(const std::string& message, const FuseResponse& response) {
|
||||
LOG(ERROR) << message << ": header.len=" << response.header.len
|
||||
<< " header.error=" << response.header.error
|
||||
<< " header.unique=" << response.header.unique;
|
||||
}
|
||||
}
|
||||
|
||||
class FuseBridgeEntry {
|
||||
|
@ -135,6 +141,7 @@ class FuseBridgeEntry {
|
|||
}
|
||||
|
||||
if (!buffer_.response.Write(device_fd_)) {
|
||||
LogResponseError("Failed to write a reply from proxy to device", buffer_.response);
|
||||
return FuseBridgeState::kClosing;
|
||||
}
|
||||
|
||||
|
@ -200,6 +207,7 @@ class FuseBridgeEntry {
|
|||
}
|
||||
|
||||
if (!buffer_.response.Write(device_fd_)) {
|
||||
LogResponseError("Failed to write a response to device", buffer_.response);
|
||||
return FuseBridgeState::kClosing;
|
||||
}
|
||||
|
||||
|
@ -215,6 +223,11 @@ class FuseBridgeEntry {
|
|||
case ResultOrAgain::kSuccess:
|
||||
return FuseBridgeState::kWaitToReadEither;
|
||||
case ResultOrAgain::kFailure:
|
||||
LOG(ERROR) << "Failed to write a request to proxy:"
|
||||
<< " header.len=" << buffer_.request.header.len
|
||||
<< " header.opcode=" << buffer_.request.header.opcode
|
||||
<< " header.unique=" << buffer_.request.header.unique
|
||||
<< " header.nodeid=" << buffer_.request.header.nodeid;
|
||||
return FuseBridgeState::kClosing;
|
||||
case ResultOrAgain::kAgain:
|
||||
return FuseBridgeState::kWaitToWriteProxy;
|
||||
|
|
|
@ -115,7 +115,10 @@ ResultOrAgain WriteInternal(const FuseMessage<T>* self, int fd, int sockflag, co
|
|||
case EAGAIN:
|
||||
return ResultOrAgain::kAgain;
|
||||
default:
|
||||
PLOG(ERROR) << "Failed to write a FUSE message";
|
||||
PLOG(ERROR) << "Failed to write a FUSE message: "
|
||||
<< "fd=" << fd << " "
|
||||
<< "sockflag=" << sockflag << " "
|
||||
<< "data=" << data;
|
||||
return ResultOrAgain::kFailure;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue