|
@@ -711,7 +711,6 @@ ip_vs_trash_get_dest(struct ip_vs_service *svc, int dest_af,
|
|
|
dest->vport == svc->port))) {
|
|
dest->vport == svc->port))) {
|
|
|
/* HIT */
|
|
/* HIT */
|
|
|
list_del(&dest->t_list);
|
|
list_del(&dest->t_list);
|
|
|
- ip_vs_dest_hold(dest);
|
|
|
|
|
goto out;
|
|
goto out;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -741,7 +740,7 @@ static void ip_vs_dest_free(struct ip_vs_dest *dest)
|
|
|
* When the ip_vs_control_clearup is activated by ipvs module exit,
|
|
* When the ip_vs_control_clearup is activated by ipvs module exit,
|
|
|
* the service tables must have been flushed and all the connections
|
|
* the service tables must have been flushed and all the connections
|
|
|
* are expired, and the refcnt of each destination in the trash must
|
|
* are expired, and the refcnt of each destination in the trash must
|
|
|
- * be 0, so we simply release them here.
|
|
|
|
|
|
|
+ * be 1, so we simply release them here.
|
|
|
*/
|
|
*/
|
|
|
static void ip_vs_trash_cleanup(struct netns_ipvs *ipvs)
|
|
static void ip_vs_trash_cleanup(struct netns_ipvs *ipvs)
|
|
|
{
|
|
{
|
|
@@ -1080,11 +1079,10 @@ static void __ip_vs_del_dest(struct netns_ipvs *ipvs, struct ip_vs_dest *dest,
|
|
|
if (list_empty(&ipvs->dest_trash) && !cleanup)
|
|
if (list_empty(&ipvs->dest_trash) && !cleanup)
|
|
|
mod_timer(&ipvs->dest_trash_timer,
|
|
mod_timer(&ipvs->dest_trash_timer,
|
|
|
jiffies + (IP_VS_DEST_TRASH_PERIOD >> 1));
|
|
jiffies + (IP_VS_DEST_TRASH_PERIOD >> 1));
|
|
|
- /* dest lives in trash without reference */
|
|
|
|
|
|
|
+ /* dest lives in trash with reference */
|
|
|
list_add(&dest->t_list, &ipvs->dest_trash);
|
|
list_add(&dest->t_list, &ipvs->dest_trash);
|
|
|
dest->idle_start = 0;
|
|
dest->idle_start = 0;
|
|
|
spin_unlock_bh(&ipvs->dest_trash_lock);
|
|
spin_unlock_bh(&ipvs->dest_trash_lock);
|
|
|
- ip_vs_dest_put(dest);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1160,7 +1158,7 @@ static void ip_vs_dest_trash_expire(unsigned long data)
|
|
|
|
|
|
|
|
spin_lock(&ipvs->dest_trash_lock);
|
|
spin_lock(&ipvs->dest_trash_lock);
|
|
|
list_for_each_entry_safe(dest, next, &ipvs->dest_trash, t_list) {
|
|
list_for_each_entry_safe(dest, next, &ipvs->dest_trash, t_list) {
|
|
|
- if (atomic_read(&dest->refcnt) > 0)
|
|
|
|
|
|
|
+ if (atomic_read(&dest->refcnt) > 1)
|
|
|
continue;
|
|
continue;
|
|
|
if (dest->idle_start) {
|
|
if (dest->idle_start) {
|
|
|
if (time_before(now, dest->idle_start +
|
|
if (time_before(now, dest->idle_start +
|