Skip to contentSkip to conversation

locking/mutex: Fix non debug version of mutex_lock_io_nested()

PATCH Applied Thomas Gleixner 3 participants 4 messages Mar 22, 2021 – Mar 23, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

If CONFIG_DEBUG_LOCK_ALLOC=n then mutex_lock_io_nested() maps to mutex_lock() which is clearly wrong because mutex_lock() lacks the io_schedule_prepare()/finish() invocations.

Map it to mutex_lock_io().

Fixes f21860bac05b ("locking/mutex, sched/wait: Fix the mutex_lock_io_nested() define")
---
 include/linux/mutex.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mutex.h +1 -1
@@ -185,7 +185,7 @@ extern void mutex_lock_io(struct mutex *
 # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock)
 # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock)
 # define mutex_lock_nest_lock(lock, nest_lock) mutex_lock(lock)
-# define mutex_lock_io_nested(lock, subclass) mutex_lock(lock)
+# define mutex_lock_io_nested(lock, subclass) mutex_lock_io(lock)
 #endif
 
 /*
maintainer
#1 lore raw
Quoted 5 lines · Thomas Gleixner

If CONFIG_DEBUG_LOCK_ALLOC=n then mutex_lock_io_nested() maps to mutex_lock() which is clearly wrong because mutex_lock() lacks the io_schedule_prepare()/finish() invocations.

Map it to mutex_lock_io().

Thanks!

#2 lore raw
In reply to Thomas Gleixner
The following commit has been merged into the locking/core branch of tip:

The following commit has been merged into the locking/core branch of tip:

Commit-ID:     ebdbd41bf2536ac57bf315ce9690245e08c5e506
Gitweb:        https://git.kernel.org/tip/ebdbd41bf2536ac57bf315ce9690245e08c5e506
Author:        Thomas Gleixner <[email protected]>
AuthorDate:    Mon, 22 Mar 2021 09:46:13 +01:00
Committer:     Peter Zijlstra <[email protected]>
CommitterDate: Mon, 22 Mar 2021 21:43:57 +01:00

locking/mutex: Fix non debug version of mutex_lock_io_nested()

If CONFIG_DEBUG_LOCK_ALLOC=n then mutex_lock_io_nested() maps to mutex_lock() which is clearly wrong because mutex_lock() lacks the io_schedule_prepare()/finish() invocations.

Map it to mutex_lock_io().

Fixes f21860bac05b ("locking/mutex, sched/wait: Fix the mutex_lock_io_nested() define")
---
 include/linux/mutex.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mutex.h +1 -1
index 0cd631a..515cff7 100644
@@ -185,7 +185,7 @@ extern void mutex_lock_io(struct mutex *lock);
 # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock)
 # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock)
 # define mutex_lock_nest_lock(lock, nest_lock) mutex_lock(lock)
-# define mutex_lock_io_nested(lock, subclass) mutex_lock(lock)
+# define mutex_lock_io_nested(lock, subclass) mutex_lock_io(lock)
 #endif
 
 /*
#3 lore raw
In reply to Thomas Gleixner
The following commit has been merged into the locking/urgent branch of tip:

The following commit has been merged into the locking/urgent branch of tip:

Commit-ID:     291da9d4a9eb3a1cb0610b7f4480f5b52b1825e7
Gitweb:        https://git.kernel.org/tip/291da9d4a9eb3a1cb0610b7f4480f5b52b1825e7
Author:        Thomas Gleixner <[email protected]>
AuthorDate:    Mon, 22 Mar 2021 09:46:13 +01:00
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Tue, 23 Mar 2021 12:20:23 +01:00

locking/mutex: Fix non debug version of mutex_lock_io_nested()

If CONFIG_DEBUG_LOCK_ALLOC=n then mutex_lock_io_nested() maps to mutex_lock() which is clearly wrong because mutex_lock() lacks the io_schedule_prepare()/finish() invocations.

Map it to mutex_lock_io().

Fixes f21860bac05b ("locking/mutex, sched/wait: Fix the mutex_lock_io_nested() define")
---
 include/linux/mutex.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mutex.h +1 -1
index 0cd631a..515cff7 100644
@@ -185,7 +185,7 @@ extern void mutex_lock_io(struct mutex *lock);
 # define mutex_lock_interruptible_nested(lock, subclass) mutex_lock_interruptible(lock)
 # define mutex_lock_killable_nested(lock, subclass) mutex_lock_killable(lock)
 # define mutex_lock_nest_lock(lock, nest_lock) mutex_lock(lock)
-# define mutex_lock_io_nested(lock, subclass) mutex_lock(lock)
+# define mutex_lock_io_nested(lock, subclass) mutex_lock_io(lock)
 #endif
 
 /*