Skip to contentSkip to conversation

mark mutex_lock*() as might_sleep()

PATCH New Ingo Molnar 1 participant 1 message Jan 10, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mark mutex_lock*() as might_sleep()

mark mutex_lock() and mutex_lock_interruptible() as might_sleep() functions.

----

 kernel/mutex.c |    2 ++
 1 files changed, 2 insertions(+)
kernel/mutex.c +2 -0
Index: linux/kernel/mutex.c
===================================================================
@@ -81,6 +81,7 @@ __mutex_lock_slowpath(atomic_t *lock_cou
  */
 void fastcall __sched mutex_lock(struct mutex *lock)
 {
+	might_sleep();
 	/*
 	 * The locking fastpath is the 1->0 transition from
 	 * 'unlocked' into 'locked' state.
@@ -253,6 +254,7 @@ __mutex_lock_interruptible_slowpath(atom
  */
 int fastcall __sched mutex_lock_interruptible(struct mutex *lock)
 {
+	might_sleep();
 	return __mutex_fastpath_lock_retval
 			(&lock->count, __mutex_lock_interruptible_slowpath);
 }