public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernfs: Clarify lockdep name for kn->count
@ 2017-08-17 15:49 Waiman Long
  2017-08-17 18:46 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Waiman Long @ 2017-08-17 15:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Tejun Heo; +Cc: linux-kernel, Waiman Long

The reference count in kernfs_node structure is treated like a rwsem by
using lockdep instrumentation code. The lockdep name, however, is still
"s_active" which is carried over from the old sysfs code. As s_active
is no longer the variable name, its use may confuse users on where the
lock is when it is reported by lockdep. So it is changed to "kn->count"
which is how this variable is normally referenced in kernfs code.

Signed-off-by: Waiman Long <longman@redhat.com>
---
 fs/kernfs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c
index ac2dfe0..e6c8954 100644
--- a/fs/kernfs/file.c
+++ b/fs/kernfs/file.c
@@ -997,7 +997,7 @@ struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
 
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 	if (key) {
-		lockdep_init_map(&kn->dep_map, "s_active", key, 0);
+		lockdep_init_map(&kn->dep_map, "kn->count", key, 0);
 		kn->flags |= KERNFS_LOCKDEP;
 	}
 #endif
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kernfs: Clarify lockdep name for kn->count
  2017-08-17 15:49 [PATCH] kernfs: Clarify lockdep name for kn->count Waiman Long
@ 2017-08-17 18:46 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2017-08-17 18:46 UTC (permalink / raw)
  To: Waiman Long; +Cc: Greg Kroah-Hartman, linux-kernel

On Thu, Aug 17, 2017 at 11:49:56AM -0400, Waiman Long wrote:
> The reference count in kernfs_node structure is treated like a rwsem by
> using lockdep instrumentation code. The lockdep name, however, is still
> "s_active" which is carried over from the old sysfs code. As s_active
> is no longer the variable name, its use may confuse users on where the
> lock is when it is reported by lockdep. So it is changed to "kn->count"
> which is how this variable is normally referenced in kernfs code.
> 
> Signed-off-by: Waiman Long <longman@redhat.com>

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-17 18:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-17 15:49 [PATCH] kernfs: Clarify lockdep name for kn->count Waiman Long
2017-08-17 18:46 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox