# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1830 -> 1.1831 # net/ipv4/ipvs/ip_vs_ctl.c 1.14 -> 1.15 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/03/23 wensong@xxxxxxxxxxxx 1.1831 # [IPVS] Fix to hold the lock before updating a service # # Brett E. noticed the missing service lock # for editing dest. # # Julian Anastasov provided the patch. # -------------------------------------------- # diff -Nru a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c --- a/net/ipv4/ipvs/ip_vs_ctl.c Tue Mar 23 00:57:58 2004 +++ b/net/ipv4/ipvs/ip_vs_ctl.c Tue Mar 23 00:57:58 2004 @@ -898,8 +898,15 @@ __ip_vs_update_dest(svc, dest, udest); + write_lock_bh(&__ip_vs_svc_lock); + + /* Wait until all other svc users go away */ + while (atomic_read(&svc->usecnt) > 1) {}; + /* call the update_service, because server weight may be changed */ svc->scheduler->update_service(svc); + + write_unlock_bh(&__ip_vs_svc_lock); LeaveFunction(2);