locking/rwsem: Fix up_read_non_owner() warning with DEBUG_RWSEMS
Subsystems (3)
Waiman Long
reviewerPATCH 1/1 locking/rwsem: Fix up_read_non_owner() warning with DEBUG_RWSEMS
It was found that the use of up_read_non_owner() in NFS was causing the following warning when DEBUG_RWSEMS was configured.
DEBUG_LOCKS_WARN_ON(sem->owner != ((struct task_struct *)(1UL << 0)))
Looking into the rwsem.c file, it was discovered that the corresponding down_read_non_owner() function was not setting the owner field properly. This is fixed now, and the warning should be gone.
--- kernel/locking/rwsem.c | 1 + 1 file changed, 1 insertion(+)
kernel/locking/rwsem.c +1 -0
@@ -181,6 +181,7 @@ void down_read_non_owner(struct rw_semaphore *sem)might_sleep ();__down_read (sem); +rwsem_set_reader_owned (sem); }EXPORT_SYMBOL (down_read_non_owner);
Signature · 1 line
1.8.3.1
Waiman Long
reviewerQuoted 19 lines · Waiman Long
It was found that the use of
up_read_non_owner()in NFS was causing the following warning whenDEBUG_RWSEMSwas configured.
DEBUG_LOCKS_WARN_ON(sem->owner != ((struct task_struct *)(1UL << 0)))Looking into the
rwsem.cfile, it was discovered that the correspondingdown_read_non_owner()function was not setting the owner field properly. This is fixed now, and the warning should be gone.Signed-off-by Waiman Long <[email protected]>--- kernel/locking/rwsem.c | 1 + 1 file changed, 1 insertion(+)kernel/locking/rwsem.c +0
-0
kernel/locking/rwsem.c void down_read_non_owner(struct rw_semaphore *sem) · line 187
Quoted 7 lines
kernel/locking/rwsem.c +1
-0@@ -181,6 +181,7 @@ void down_read_non_owner(struct rw_semaphore *sem)might_sleep ();tch __down_read (sem ); +rwsem_set_reader_owned (sem); }EXPORT_SYMBOL (down_read_non_owner);
Since the 4.18 merge window has been closed. Can that patch be merged upstream?
Cheers,
Longman
Schenk, Gavin
Tested-byHi,
Quoted 11 lines · Waiman Long
Quoted 10 lines · Waiman Long
It was found that the use of
up_read_non_owner()in NFS was causing the following warning whenDEBUG_RWSEMSwas configured.
DEBUG_LOCKS_WARN_ON(sem->owner != ((struct task_struct *)(1UL << 0)))Looking into the
rwsem.cfile, it was discovered that the correspondingdown_read_non_owner()function was not setting the owner field properly. This is fixed now, and the warning should be gone.Signed-off-by Waiman Long <[email protected]>
This fixes my reproducible locking splat when booting with nfsroot and changing password. Thank you!
Regards
Gavin Schenk
Quoted 10 lines · Waiman Long
It was found that the use of
up_read_non_owner()in NFS was causing the following warning whenDEBUG_RWSEMSwas configured.
DEBUG_LOCKS_WARN_ON(sem->owner != ((struct task_struct *)(1UL << 0)))Looking into the
rwsem.cfile, it was discovered that the correspondingdown_read_non_owner()function was not setting the owner field properly. This is fixed now, and the warning should be gone.Signed-off-by Waiman Long <[email protected]>
Quoted 19 lines
--- kernel/locking/rwsem.c | 1 + 1 file changed, 1 insertion(+)kernel/locking/rwsem.c +1
-0@@ -181,6 +181,7 @@ void down_read_non_owner(struct rw_semaphore *sem)might_sleep ();__down_read (sem); +rwsem_set_reader_owned (sem); }EXPORT_SYMBOL (down_read_non_owner);Signature · 1 line
1.8.3.1
tip-bot for Waiman Long
merge botlocking/rwsem: Fix up_read_non_owner() warning with DEBUG_RWSEMS
Commit-ID: 03eeafdd9ab06a770d42c2b264d50dff7e2f4eee Gitweb: https://git.kernel.org/tip/03eeafdd9ab06a770d42c2b264d50dff7e2f4eee Author: Waiman Long <[email protected]> AuthorDate: Thu, 24 May 2018 09:26:38 -0400 Committer: Thomas Gleixner <[email protected]> CommitDate: Wed, 20 Jun 2018 11:29:23 +0200
locking/rwsem: Fix up_read_non_owner() warning with DEBUG_RWSEMS
It was found that the use of up_read_non_owner() in NFS was causing the following warning when DEBUG_RWSEMS was configured.
DEBUG_LOCKS_WARN_ON(sem->owner != ((struct task_struct *)(1UL << 0)))
Looking into the rwsem.c file, it was discovered that the corresponding down_read_non_owner() function was not setting the owner field properly. This is fixed now, and the warning should be gone.
--- kernel/locking/rwsem.c | 1 + 1 file changed, 1 insertion(+)
kernel/locking/rwsem.c +1 -0
@@ -181,6 +181,7 @@ void down_read_non_owner(struct rw_semaphore *sem)might_sleep ();__down_read (sem); +rwsem_set_reader_owned (sem); }EXPORT_SYMBOL (down_read_non_owner);