Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4632
b: refs/heads/master
c: af9debd
h: refs/heads/master
v: v3
  • Loading branch information
Julian Anastasov authored and David S. Miller committed Jul 12, 2005
1 parent c6b5e49 commit 34d51f1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f5b8adb4f5767415b7b00e32e4766a052e2ed4cc
refs/heads/master: af9debd461d10fe582c9c0e80eafa69f698331ed
6 changes: 3 additions & 3 deletions trunk/net/ipv4/ipvs/ip_vs_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ static inline int todrop_entry(struct ip_vs_conn *cp)
return 1;
}


/* Called from keventd and must protect itself from softirqs */
void ip_vs_random_dropentry(void)
{
int idx;
Expand All @@ -773,7 +773,7 @@ void ip_vs_random_dropentry(void)
/*
* Lock is actually needed in this loop.
*/
ct_write_lock(hash);
ct_write_lock_bh(hash);

list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) {
if (!cp->cport && !(cp->flags & IP_VS_CONN_F_NO_CPORT))
Expand Down Expand Up @@ -806,7 +806,7 @@ void ip_vs_random_dropentry(void)
ip_vs_conn_expire_now(cp->control);
}
}
ct_write_unlock(hash);
ct_write_unlock_bh(hash);
}
}

Expand Down
9 changes: 6 additions & 3 deletions trunk/net/ipv4/ipvs/ip_vs_ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ int ip_vs_get_debug_level(void)
#endif

/*
* update_defense_level is called from keventd and from sysctl.
* update_defense_level is called from keventd and from sysctl,
* so it needs to protect itself from softirqs
*/
static void update_defense_level(void)
{
Expand All @@ -110,6 +111,8 @@ static void update_defense_level(void)

nomem = (availmem < sysctl_ip_vs_amemthresh);

local_bh_disable();

/* drop_entry */
spin_lock(&__ip_vs_dropentry_lock);
switch (sysctl_ip_vs_drop_entry) {
Expand Down Expand Up @@ -206,6 +209,8 @@ static void update_defense_level(void)
if (to_change >= 0)
ip_vs_protocol_timeout_change(sysctl_ip_vs_secure_tcp>1);
write_unlock(&__ip_vs_securetcp_lock);

local_bh_enable();
}


Expand Down Expand Up @@ -1360,9 +1365,7 @@ proc_do_defense_mode(ctl_table *table, int write, struct file * filp,
/* Restore the correct value */
*valp = val;
} else {
local_bh_disable();
update_defense_level();
local_bh_enable();
}
}
return rc;
Expand Down

0 comments on commit 34d51f1

Please sign in to comment.