https://github.com/MariaDB/server/commit/862eccd5244219b59ffcfa86bb203478d45d30a8

Index: mariadb-10.6-10.6.5/storage/innobase/include/buf0types.h
===================================================================
--- mariadb-10.6-10.6.5.orig/storage/innobase/include/buf0types.h
+++ mariadb-10.6-10.6.5/storage/innobase/include/buf0types.h
@@ -191,10 +191,8 @@ public:
   /** Acquire an exclusive lock */
   inline void lock();
 
-#ifdef UNIV_DEBUG
   /** @return whether an exclusive lock is being held by any thread */
   bool is_write_locked() const { return rw_lock::is_write_locked(); }
-#endif
 
   /** @return whether any lock is being held by any thread */
   bool is_locked() const { return rw_lock::is_locked(); }
Index: mariadb-10.6-10.6.5/storage/innobase/include/srw_lock.h
===================================================================
--- mariadb-10.6-10.6.5.orig/storage/innobase/include/srw_lock.h
+++ mariadb-10.6-10.6.5/storage/innobase/include/srw_lock.h
@@ -137,6 +137,7 @@ public:
   void destroy();
   /** @return whether any writer is waiting */
   bool is_waiting() const { return (value() & WRITER_WAITING) != 0; }
+  bool is_write_locked() const { return rw_lock::is_write_locked(); }
 
   bool rd_lock_try() { uint32_t l; return read_trylock(l); }
   bool wr_lock_try() { return write_trylock(); }
