git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git]
/
net
/
ipv4
/
ipvs
/
ip_vs_ctl.c
diff --git
a/net/ipv4/ipvs/ip_vs_ctl.c
b/net/ipv4/ipvs/ip_vs_ctl.c
index
6a28faf
..
7f0288b
100644
(file)
--- a/
net/ipv4/ipvs/ip_vs_ctl.c
+++ b/
net/ipv4/ipvs/ip_vs_ctl.c
@@
-34,7
+34,6
@@
#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
-#include <linux/mutex.h>
#include <net/ip.h>
#include <net/route.h>
#include <net/ip.h>
#include <net/route.h>
@@
-45,7
+44,7
@@
#include <net/ip_vs.h>
/* semaphore for IPVS sockopts. And, [gs]etsockopt may sleep. */
#include <net/ip_vs.h>
/* semaphore for IPVS sockopts. And, [gs]etsockopt may sleep. */
-static DE
FIN
E_MUTEX(__ip_vs_mutex);
+static DE
CLAR
E_MUTEX(__ip_vs_mutex);
/* lock for service table */
static DEFINE_RWLOCK(__ip_vs_svc_lock);
/* lock for service table */
static DEFINE_RWLOCK(__ip_vs_svc_lock);
@@
-735,11
+734,12
@@
ip_vs_new_dest(struct ip_vs_service *svc, struct ip_vs_dest_user *udest,
if (atype != RTN_LOCAL && atype != RTN_UNICAST)
return -EINVAL;
if (atype != RTN_LOCAL && atype != RTN_UNICAST)
return -EINVAL;
- dest = k
z
alloc(sizeof(struct ip_vs_dest), GFP_ATOMIC);
+ dest = k
m
alloc(sizeof(struct ip_vs_dest), GFP_ATOMIC);
if (dest == NULL) {
IP_VS_ERR("ip_vs_new_dest: kmalloc failed.\n");
return -ENOMEM;
}
if (dest == NULL) {
IP_VS_ERR("ip_vs_new_dest: kmalloc failed.\n");
return -ENOMEM;
}
+ memset(dest, 0, sizeof(struct ip_vs_dest));
dest->protocol = svc->protocol;
dest->vaddr = svc->addr;
dest->protocol = svc->protocol;
dest->vaddr = svc->addr;
@@
-1049,12
+1049,14
@@
ip_vs_add_service(struct ip_vs_service_user *u, struct ip_vs_service **svc_p)
goto out_mod_dec;
}
goto out_mod_dec;
}
- svc = kzalloc(sizeof(struct ip_vs_service), GFP_ATOMIC);
+ svc = (struct ip_vs_service *)
+ kmalloc(sizeof(struct ip_vs_service), GFP_ATOMIC);
if (svc == NULL) {
IP_VS_DBG(1, "ip_vs_add_service: kmalloc failed.\n");
ret = -ENOMEM;
goto out_err;
}
if (svc == NULL) {
IP_VS_DBG(1, "ip_vs_add_service: kmalloc failed.\n");
ret = -ENOMEM;
goto out_err;
}
+ memset(svc, 0, sizeof(struct ip_vs_service));
/* I'm the first user of the service */
atomic_set(&svc->usecnt, 1);
/* I'm the first user of the service */
atomic_set(&svc->usecnt, 1);
@@
-1794,7
+1796,7
@@
static int ip_vs_info_open(struct inode *inode, struct file *file)
{
struct seq_file *seq;
int rc = -ENOMEM;
{
struct seq_file *seq;
int rc = -ENOMEM;
- struct ip_vs_iter *s = k
z
alloc(sizeof(*s), GFP_KERNEL);
+ struct ip_vs_iter *s = k
m
alloc(sizeof(*s), GFP_KERNEL);
if (!s)
goto out;
if (!s)
goto out;
@@
-1805,6
+1807,7
@@
static int ip_vs_info_open(struct inode *inode, struct file *file)
seq = file->private_data;
seq->private = s;
seq = file->private_data;
seq->private = s;
+ memset(s, 0, sizeof(*s));
out:
return rc;
out_kfree:
out:
return rc;
out_kfree:
@@
-1947,7
+1950,7
@@
do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
/* increase the module use count */
ip_vs_use_count_inc();
/* increase the module use count */
ip_vs_use_count_inc();
- if (
mutex_lock
_interruptible(&__ip_vs_mutex)) {
+ if (
down
_interruptible(&__ip_vs_mutex)) {
ret = -ERESTARTSYS;
goto out_dec;
}
ret = -ERESTARTSYS;
goto out_dec;
}
@@
-2038,7
+2041,7
@@
do_ip_vs_set_ctl(struct sock *sk, int cmd, void __user *user, unsigned int len)
ip_vs_service_put(svc);
out_unlock:
ip_vs_service_put(svc);
out_unlock:
-
mutex_unlock
(&__ip_vs_mutex);
+
up
(&__ip_vs_mutex);
out_dec:
/* decrease the module use count */
ip_vs_use_count_dec();
out_dec:
/* decrease the module use count */
ip_vs_use_count_dec();
@@
-2208,7
+2211,7
@@
do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
if (copy_from_user(arg, user, get_arglen[GET_CMDID(cmd)]) != 0)
return -EFAULT;
if (copy_from_user(arg, user, get_arglen[GET_CMDID(cmd)]) != 0)
return -EFAULT;
- if (
mutex_lock
_interruptible(&__ip_vs_mutex))
+ if (
down
_interruptible(&__ip_vs_mutex))
return -ERESTARTSYS;
switch (cmd) {
return -ERESTARTSYS;
switch (cmd) {
@@
-2327,7
+2330,7
@@
do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
}
out:
}
out:
-
mutex_unlock
(&__ip_vs_mutex);
+
up
(&__ip_vs_mutex);
return ret;
}
return ret;
}