Skip to contentSkip to conversation

cleanup: no need to call rcu_lock in sock_update_classid()

PATCH In review Glauber Costa 2 participants 2 messages Sep 6, 2011 – Sep 9, 2011

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

PATCH 1/1 cleanup: no need to call rcu_lock in sock_update_classid()

There is no need to protect

According to the all-knowing git log, this was inserted here to prevent a warning in commit 1144182a. But 3fb5a991 also does that in a different place.

Quoted 1 line

From reading it, I believe they are fixing the same warning, so no need

for both.

CC Paul E. McKenney <[email protected]>
CC Li Zefan <[email protected]>
CC David S. Miller <[email protected]>
---
 net/core/sock.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
net/core/sock.c +0 -2
index bc745d0..3449df8 100644
@@ -1107,9 +1107,7 @@ void sock_update_classid(struct sock *sk)
 {
 	u32 classid;
 
-	rcu_read_lock();  /* doing current task, which cannot vanish. */
 	classid = task_cls_classid(current);
-	rcu_read_unlock();
 	if (classid && classid != sk->sk_classid)
 		sk->sk_classid = classid;
 }
Signature · 1 line
1.7.6
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Glauber Costa

There is no need to protect

According to the all-knowing git log, this was inserted here to prevent a warning in commit 1144182a. But 3fb5a991 also does that in a different place.

Quoted 1 line

From reading it, I believe they are fixing the same warning, so no need

for both.

Good catch!

Quoted 25 lines
CC Paul E. McKenney <[email protected]>
CC Li Zefan <[email protected]>
CC David S. Miller <[email protected]>
---
 net/core/sock.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
net/core/sock.c +0 -2
index bc745d0..3449df8 100644
@@ -1107,9 +1107,7 @@ void sock_update_classid(struct sock *sk)
 {
 	u32 classid;
 
-	rcu_read_lock();  /* doing current task, which cannot vanish. */
 	classid = task_cls_classid(current);
-	rcu_read_unlock();
 	if (classid && classid != sk->sk_classid)
 		sk->sk_classid = classid;
 }
Signature · 1 line
1.7.6