ANDROID: rust_binder: don't pr_warn on benign errors

Currently, we will pr_warn to the kernel log if you try to send a
message to a process that is frozen or dead. This isn't really
necessary and adds a lot of noise to the log. Let's silence these
errors.

Fixes: bb1d504151 ("ANDROID: rust_binder: add oneway transactions")
Change-Id: Ie0ec8ee5853413a7abe9c1b7d70ed4a9806f41e7
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
This commit is contained in:
Alice Ryhl 2024-04-17 08:29:26 +00:00
parent ce08a08a3e
commit 64018a934a
2 changed files with 5 additions and 1 deletions

View File

@ -37,6 +37,10 @@ impl BinderError {
}
}
pub(crate) fn should_pr_warn(&self) -> bool {
self.source.is_some()
}
pub(crate) fn is_dead(&self) -> bool {
self.reply == BR_DEAD_REPLY
}

View File

@ -1248,7 +1248,7 @@ impl Thread {
T: FnOnce(&Arc<Self>, &BinderTransactionDataSg) -> BinderResult,
{
if let Err(err) = inner(self, tr) {
if err.reply != BR_TRANSACTION_COMPLETE {
if err.should_pr_warn() {
let mut ee = self.inner.lock().extended_error;
ee.command = err.reply;
ee.param = err.as_errno();