|
@@ -162,6 +162,7 @@ static inline int ip_vs_conn_hash(struct ip_vs_conn *cp)
|
|
hash = ip_vs_conn_hashkey(cp->af, cp->protocol, &cp->caddr, cp->cport);
|
|
hash = ip_vs_conn_hashkey(cp->af, cp->protocol, &cp->caddr, cp->cport);
|
|
|
|
|
|
ct_write_lock(hash);
|
|
ct_write_lock(hash);
|
|
|
|
+ spin_lock(&cp->lock);
|
|
|
|
|
|
if (!(cp->flags & IP_VS_CONN_F_HASHED)) {
|
|
if (!(cp->flags & IP_VS_CONN_F_HASHED)) {
|
|
list_add(&cp->c_list, &ip_vs_conn_tab[hash]);
|
|
list_add(&cp->c_list, &ip_vs_conn_tab[hash]);
|
|
@@ -174,6 +175,7 @@ static inline int ip_vs_conn_hash(struct ip_vs_conn *cp)
|
|
ret = 0;
|
|
ret = 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ spin_unlock(&cp->lock);
|
|
ct_write_unlock(hash);
|
|
ct_write_unlock(hash);
|
|
|
|
|
|
return ret;
|
|
return ret;
|
|
@@ -193,6 +195,7 @@ static inline int ip_vs_conn_unhash(struct ip_vs_conn *cp)
|
|
hash = ip_vs_conn_hashkey(cp->af, cp->protocol, &cp->caddr, cp->cport);
|
|
hash = ip_vs_conn_hashkey(cp->af, cp->protocol, &cp->caddr, cp->cport);
|
|
|
|
|
|
ct_write_lock(hash);
|
|
ct_write_lock(hash);
|
|
|
|
+ spin_lock(&cp->lock);
|
|
|
|
|
|
if (cp->flags & IP_VS_CONN_F_HASHED) {
|
|
if (cp->flags & IP_VS_CONN_F_HASHED) {
|
|
list_del(&cp->c_list);
|
|
list_del(&cp->c_list);
|
|
@@ -202,6 +205,7 @@ static inline int ip_vs_conn_unhash(struct ip_vs_conn *cp)
|
|
} else
|
|
} else
|
|
ret = 0;
|
|
ret = 0;
|
|
|
|
|
|
|
|
+ spin_unlock(&cp->lock);
|
|
ct_write_unlock(hash);
|
|
ct_write_unlock(hash);
|
|
|
|
|
|
return ret;
|
|
return ret;
|