diff --git a/storage/innobase/include/sync0rw.ic b/storage/innobase/include/sync0rw.ic
index 2ffd9fdafb56b30e93254a020eedc4ad8cc7fc7d..51cf7121b4c95b618fb918a8080e72dd214366a6 100644
--- a/storage/innobase/include/sync0rw.ic
+++ b/storage/innobase/include/sync0rw.ic
@@ -406,6 +406,7 @@ rw_lock_s_lock_func(
 
 #ifdef UNIV_SYNC_DEBUG
 	ut_ad(!rw_lock_own(lock, RW_LOCK_SHARED)); /* see NOTE above */
+	ut_ad(!rw_lock_own(lock, RW_LOCK_EX));
 #endif /* UNIV_SYNC_DEBUG */
 
 	/* TODO: study performance of UNIV_LIKELY branch prediction hints. */
diff --git a/storage/innobase/sync/sync0rw.c b/storage/innobase/sync/sync0rw.c
index 0f0df71316ede16197229860a2b86e62faaa900c..fc4f987fe659b45a081faa83565335a989a3a2a5 100644
--- a/storage/innobase/sync/sync0rw.c
+++ b/storage/innobase/sync/sync0rw.c
@@ -626,6 +626,9 @@ rw_lock_x_lock_func(
 	ibool	spinning = FALSE;
 
 	ut_ad(rw_lock_validate(lock));
+#ifdef UNIV_SYNC_DEBUG
+	ut_ad(!rw_lock_own(lock, RW_LOCK_SHARED));
+#endif /* UNIV_SYNC_DEBUG */
 
 	i = 0;