aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/locking/mutex.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-08-06 21:44:57 -0400
committerDavid S. Miller <davem@davemloft.net>2019-08-06 21:44:57 -0400
commit13dfb3fa494361ea9a5950f27c9cd8b06d28c04f (patch)
tree1bf30874f57c6c6b21160a10282191fcd0868055 /kernel/locking/mutex.c
parent05bb520376af2c5146d3c44832c22ec3bb54d778 (diff)
parent33920f1ec5bf47c5c0a1d2113989bdd9dfb3fae9 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Just minor overlapping changes in the conflicts here. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/locking/mutex.c')
-rw-r--r--kernel/locking/mutex.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
index edd1c082dbf5..5e069734363c 100644
--- a/kernel/locking/mutex.c
+++ b/kernel/locking/mutex.c
@@ -908,6 +908,10 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
908 908
909 might_sleep(); 909 might_sleep();
910 910
911#ifdef CONFIG_DEBUG_MUTEXES
912 DEBUG_LOCKS_WARN_ON(lock->magic != lock);
913#endif
914
911 ww = container_of(lock, struct ww_mutex, base); 915 ww = container_of(lock, struct ww_mutex, base);
912 if (use_ww_ctx && ww_ctx) { 916 if (use_ww_ctx && ww_ctx) {
913 if (unlikely(ww_ctx == READ_ONCE(ww->ctx))) 917 if (unlikely(ww_ctx == READ_ONCE(ww->ctx)))
@@ -1379,8 +1383,13 @@ __ww_mutex_lock_interruptible_slowpath(struct ww_mutex *lock,
1379 */ 1383 */
1380int __sched mutex_trylock(struct mutex *lock) 1384int __sched mutex_trylock(struct mutex *lock)
1381{ 1385{
1382 bool locked = __mutex_trylock(lock); 1386 bool locked;
1387
1388#ifdef CONFIG_DEBUG_MUTEXES
1389 DEBUG_LOCKS_WARN_ON(lock->magic != lock);
1390#endif
1383 1391
1392 locked = __mutex_trylock(lock);
1384 if (locked) 1393 if (locked)
1385 mutex_acquire(&lock->dep_map, 0, 1, _RET_IP_); 1394 mutex_acquire(&lock->dep_map, 0, 1, _RET_IP_);
1386 1395