Skip to content

Commit 00a87e5

Browse files
committed
SUNRPC: Address RCU warning in net/sunrpc/svc.c
$ make C=1 W=1 net/sunrpc/svc.o make[1]: Entering directory 'linux/obj/manet.1015granger.net' GEN Makefile CALL linux/server-development/scripts/checksyscalls.sh DESCEND objtool INSTALL libsubcmd_headers DESCEND bpf/resolve_btfids INSTALL libsubcmd_headers CC [M] net/sunrpc/svc.o CHECK linux/server-development/net/sunrpc/svc.c linux/server-development/net/sunrpc/svc.c:1225:9: warning: incorrect type in argument 1 (different address spaces) linux/server-development/net/sunrpc/svc.c:1225:9: expected struct spinlock [usertype] *lock linux/server-development/net/sunrpc/svc.c:1225:9: got struct spinlock [noderef] __rcu * linux/server-development/net/sunrpc/svc.c:1227:40: warning: incorrect type in argument 1 (different address spaces) linux/server-development/net/sunrpc/svc.c:1227:40: expected struct spinlock [usertype] *lock linux/server-development/net/sunrpc/svc.c:1227:40: got struct spinlock [noderef] __rcu * make[1]: Leaving directory 'linux/obj/manet.1015granger.net' Warning introduced by commit 913292c ("sched.h: Annotate sighand_struct with __rcu"). Signed-off-by: Chuck Lever <[email protected]>
1 parent a9156d7 commit 00a87e5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

net/sunrpc/svc.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,7 @@ static void __svc_unregister(struct net *net, const u32 program, const u32 versi
11641164
*/
11651165
static void svc_unregister(const struct svc_serv *serv, struct net *net)
11661166
{
1167+
struct sighand_struct *sighand;
11671168
struct svc_program *progp;
11681169
unsigned long flags;
11691170
unsigned int i;
@@ -1180,9 +1181,12 @@ static void svc_unregister(const struct svc_serv *serv, struct net *net)
11801181
}
11811182
}
11821183

1183-
spin_lock_irqsave(&current->sighand->siglock, flags);
1184+
rcu_read_lock();
1185+
sighand = rcu_dereference(current->sighand);
1186+
spin_lock_irqsave(&sighand->siglock, flags);
11841187
recalc_sigpending();
1185-
spin_unlock_irqrestore(&current->sighand->siglock, flags);
1188+
spin_unlock_irqrestore(&sighand->siglock, flags);
1189+
rcu_read_unlock();
11861190
}
11871191

11881192
/*

0 commit comments

Comments
 (0)