diff --git a/drivers/android/binder/node.rs b/drivers/android/binder/node.rs index 23148d3c9597..738ce34776f6 100644 --- a/drivers/android/binder/node.rs +++ b/drivers/android/binder/node.rs @@ -723,7 +723,7 @@ impl Node { if len == inner.freeze_list.len() { pr_warn!( "Could not remove freeze listener for {}\n", - p.task.pid_in_current_ns() + p.pid_in_current_ns() ); } if inner.freeze_list.is_empty() { diff --git a/drivers/android/binder/process.rs b/drivers/android/binder/process.rs index a46267b5fdf9..d630fc067324 100644 --- a/drivers/android/binder/process.rs +++ b/drivers/android/binder/process.rs @@ -511,9 +511,13 @@ impl Process { Ok(process) } + pub(crate) fn pid_in_current_ns(&self) -> kernel::task::Pid { + self.task.tgid_nr_ns(None) + } + #[inline(never)] pub(crate) fn debug_print_stats(&self, m: &SeqFile, ctx: &Context) -> Result<()> { - seq_print!(m, "proc {}\n", self.task.pid_in_current_ns()); + seq_print!(m, "proc {}\n", self.pid_in_current_ns()); seq_print!(m, "context {}\n", &*ctx.name); let inner = self.inner.lock(); @@ -561,7 +565,7 @@ impl Process { #[inline(never)] pub(crate) fn debug_print(&self, m: &SeqFile, ctx: &Context, print_all: bool) -> Result<()> { - seq_print!(m, "proc {}\n", self.task.pid_in_current_ns()); + seq_print!(m, "proc {}\n", self.pid_in_current_ns()); seq_print!(m, "context {}\n", &*ctx.name); let mut all_threads = KVec::new(); diff --git a/drivers/android/binder/thread.rs b/drivers/android/binder/thread.rs index 5352f5deaac8..362d72052d60 100644 --- a/drivers/android/binder/thread.rs +++ b/drivers/android/binder/thread.rs @@ -1299,7 +1299,7 @@ impl Thread { pr_warn!( "Transaction failed: {:?} my_pid:{}", err, - self.process.task.pid_in_current_ns() + self.process.pid_in_current_ns() ); } @@ -1584,7 +1584,7 @@ impl Thread { pr_warn!( "Write failure {:?} in pid:{}", err, - self.process.task.pid_in_current_ns() + self.process.pid_in_current_ns() ); req.read_consumed = 0; writer.write(&req)?; @@ -1601,7 +1601,7 @@ impl Thread { pr_warn!( "Read failure {:?} in pid:{}", ret, - self.process.task.pid_in_current_ns() + self.process.pid_in_current_ns() ); } } diff --git a/drivers/android/binder/transaction.rs b/drivers/android/binder/transaction.rs index 240bbac341de..1477b93af7b1 100644 --- a/drivers/android/binder/transaction.rs +++ b/drivers/android/binder/transaction.rs @@ -429,7 +429,7 @@ impl DeliverToRead for Transaction { tr.sender_pid = 0; if self.target_node.is_some() && self.flags & TF_ONE_WAY == 0 { // Not a reply and not one-way. - tr.sender_pid = self.from.process.task.pid_in_current_ns(); + tr.sender_pid = self.from.process.pid_in_current_ns(); } let code = if self.target_node.is_none() { BR_REPLY