netfilter: don't use mutex_lock_interruptible()
Eric Dumazet reports that getsockopt() or setsockopt() sometimes returns -EINTR instead of -ENOPROTOOPT, causing headaches to application developers. This patch replaces all the mutex_lock_interruptible() by mutex_lock() in the netfilter tree, as there is no reason we should sleep for a long time there. Reported-by: Eric Dumazet <edumazet@google.com> Suggested-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Acked-by: Julian Anastasov <ja@ssi.bg>
This commit is contained in:
@@ -2271,10 +2271,7 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
|
||||
cmd == IP_VS_SO_SET_STOPDAEMON) {
|
||||
struct ip_vs_daemon_user *dm = (struct ip_vs_daemon_user *)arg;
|
||||
|
||||
if (mutex_lock_interruptible(&ipvs->sync_mutex)) {
|
||||
ret = -ERESTARTSYS;
|
||||
goto out_dec;
|
||||
}
|
||||
mutex_lock(&ipvs->sync_mutex);
|
||||
if (cmd == IP_VS_SO_SET_STARTDAEMON)
|
||||
ret = start_sync_thread(net, dm->state, dm->mcast_ifn,
|
||||
dm->syncid);
|
||||
@@ -2284,11 +2281,7 @@ do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
|
||||
goto out_dec;
|
||||
}
|
||||
|
||||
if (mutex_lock_interruptible(&__ip_vs_mutex)) {
|
||||
ret = -ERESTARTSYS;
|
||||
goto out_dec;
|
||||
}
|
||||
|
||||
mutex_lock(&__ip_vs_mutex);
|
||||
if (cmd == IP_VS_SO_SET_FLUSH) {
|
||||
/* Flush the virtual service */
|
||||
ret = ip_vs_flush(net, false);
|
||||
@@ -2573,9 +2566,7 @@ do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
|
||||
struct ip_vs_daemon_user d[2];
|
||||
|
||||
memset(&d, 0, sizeof(d));
|
||||
if (mutex_lock_interruptible(&ipvs->sync_mutex))
|
||||
return -ERESTARTSYS;
|
||||
|
||||
mutex_lock(&ipvs->sync_mutex);
|
||||
if (ipvs->sync_state & IP_VS_STATE_MASTER) {
|
||||
d[0].state = IP_VS_STATE_MASTER;
|
||||
strlcpy(d[0].mcast_ifn, ipvs->master_mcast_ifn,
|
||||
@@ -2594,9 +2585,7 @@ do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (mutex_lock_interruptible(&__ip_vs_mutex))
|
||||
return -ERESTARTSYS;
|
||||
|
||||
mutex_lock(&__ip_vs_mutex);
|
||||
switch (cmd) {
|
||||
case IP_VS_SO_GET_VERSION:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user