# 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.1336 -> 1.1337 # net/ipv4/ipvs/ip_vs_ctl.c 1.5 -> 1.6 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/03/22 wensong@xxxxxxxxxxxx 1.1337 # [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 Mon Mar 22 23:10:47 2004 +++ b/net/ipv4/ipvs/ip_vs_ctl.c Mon Mar 22 23:10:47 2004 @@ -889,8 +889,15 @@ __ip_vs_update_dest(svc, dest, ur); + 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);