Re: [PATCH v4 09/10] mm/vma: update vma_assert_locked() to use lockdep

From: Lorenzo Stoakes

Date: Mon Jan 26 2026 - 12:38:03 EST


Hi Andrew,

Could you apply the attached fix-patch to apply Vlasta's suggestion, and to
avoid unnecessary ifdeffery.

Could you also adjust the original commit message to append the below?
Thanks!

-->
Additionally, abstract references to vma->vmlock_dep_map by introducing a
macro helper __vma_lockdep_map() which accesses this field if lockdep is
enabled.

Since lock_is_held() is specified as an extern function if lockdep is
disabled, we can simply have __vma_lockdep_map() defined as NULL in this
case, and then use IS_ENABLED(CONFIG_LOCKDEP) to avoid ugly ifdeffery.
<--

Cheers, Lorenzo


----8<----