Re: [PATCH v4] rust_binder: unregister shrinker if binderfs initialization fails
From: Shuai Liu
Date: Thu Dec 03 2026 - 00:28:16 EST
Hi Poil,
Reviewed-by: Shuai Liu <847807867@xxxxxx>
I reviewed the patch and verified it:
- Applied cleanly on top of master (d06ce6f1eb5ee).
- Build-tested with CONFIG_RUST=y and CONFIG_ANDROID_BINDER_IPC_RUST=y
(clang 18, rustc 1.100); the Rust Binder object compiles cleanly.
- Boot-tested in QEMU: the Rust kernel KUnit suites pass and
rust_binderfs mounts with the expected devices (binder, hwbinder,
vndbinder, binder-control, features) and unmounts cleanly, no
warnings in the boot log.
- The unregister() ordering is correct: shrinker_free() before
list_lru_destroy(). mm/shrinker.c confirms shrinker_free() waits
for in-flight callbacks via wait_for_completion() and never touches
the caller-owned list_lru, so destroying the list_lru afterwards is
safe and no double-destroy can happen (list_lru_destroy() is
idempotent anyway).
One side note: the pre-existing Error::from_errno(ret) with ret == 0
in the shrinker_alloc() failure path of Shrinker::register() is
already addressed by Adhyansh Verma's pending patch "rust_binder:
return ENOMEM on shrinker allocation failure", so nothing to do here.
Thanks,
Shuai Liu