diff options
author | Julian Anastasov <ja@ssi.bg> | 2005-07-11 23:59:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-07-11 23:59:57 -0400 |
commit | af9debd461d10fe582c9c0e80eafa69f698331ed (patch) | |
tree | f9473e1ec1c1ec18bf90ff8049fe63f5abd35ef7 /net/ipv4/ipvs/ip_vs_ctl.c | |
parent | f5b8adb4f5767415b7b00e32e4766a052e2ed4cc (diff) |
[IPVS]: Add and reorder bh locks after moving to keventd.
An addition to the last ipvs changes that move
update_defense_level/si_meminfo to keventd:
- ip_vs_random_dropentry now runs in process context and should use _bh
locks to protect from softirqs
- update_defense_level still needs _bh locks after si_meminfo is called,
for the same purpose
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipvs/ip_vs_ctl.c')
-rw-r--r-- | net/ipv4/ipvs/ip_vs_ctl.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c index 12a82e91d22..7d99ede2ef7 100644 --- a/net/ipv4/ipvs/ip_vs_ctl.c +++ b/net/ipv4/ipvs/ip_vs_ctl.c | |||
@@ -90,7 +90,8 @@ int ip_vs_get_debug_level(void) | |||
90 | #endif | 90 | #endif |
91 | 91 | ||
92 | /* | 92 | /* |
93 | * update_defense_level is called from keventd and from sysctl. | 93 | * update_defense_level is called from keventd and from sysctl, |
94 | * so it needs to protect itself from softirqs | ||
94 | */ | 95 | */ |
95 | static void update_defense_level(void) | 96 | static void update_defense_level(void) |
96 | { | 97 | { |
@@ -110,6 +111,8 @@ static void update_defense_level(void) | |||
110 | 111 | ||
111 | nomem = (availmem < sysctl_ip_vs_amemthresh); | 112 | nomem = (availmem < sysctl_ip_vs_amemthresh); |
112 | 113 | ||
114 | local_bh_disable(); | ||
115 | |||
113 | /* drop_entry */ | 116 | /* drop_entry */ |
114 | spin_lock(&__ip_vs_dropentry_lock); | 117 | spin_lock(&__ip_vs_dropentry_lock); |
115 | switch (sysctl_ip_vs_drop_entry) { | 118 | switch (sysctl_ip_vs_drop_entry) { |
@@ -206,6 +209,8 @@ static void update_defense_level(void) | |||
206 | if (to_change >= 0) | 209 | if (to_change >= 0) |
207 | ip_vs_protocol_timeout_change(sysctl_ip_vs_secure_tcp>1); | 210 | ip_vs_protocol_timeout_change(sysctl_ip_vs_secure_tcp>1); |
208 | write_unlock(&__ip_vs_securetcp_lock); | 211 | write_unlock(&__ip_vs_securetcp_lock); |
212 | |||
213 | local_bh_enable(); | ||
209 | } | 214 | } |
210 | 215 | ||
211 | 216 | ||
@@ -1360,9 +1365,7 @@ proc_do_defense_mode(ctl_table *table, int write, struct file * filp, | |||
1360 | /* Restore the correct value */ | 1365 | /* Restore the correct value */ |
1361 | *valp = val; | 1366 | *valp = val; |
1362 | } else { | 1367 | } else { |
1363 | local_bh_disable(); | ||
1364 | update_defense_level(); | 1368 | update_defense_level(); |
1365 | local_bh_enable(); | ||
1366 | } | 1369 | } |
1367 | } | 1370 | } |
1368 | return rc; | 1371 | return rc; |