Message ID | 20220603202448.367014-1-ihrachys@redhat.com |
---|---|
State | Accepted |
Headers | show |
Series | [ovs-dev] Lock pinctrl_mutex for pinctrl_wait | expand |
Context | Check | Description |
---|---|---|
ovsrobot/apply-robot | success | apply and check: success |
ovsrobot/github-robot-_Build_and_Test | fail | github build: failed |
ovsrobot/github-robot-_ovn-kubernetes | success | github build: passed |
Thanks Ihar, I pushed this change to main, branch-22.06, branch-22.03, and branch-21.12. On 6/3/22 16:24, Ihar Hrachyshka wrote: > The function is called from main thread, and wait_* subprocedures access > data structures that are managed by pinctrl thread, so make sure the > access to them is guarded. > > Signed-off-by: Ihar Hrachyshka <ihrachys@redhat.com> > --- > controller/pinctrl.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/controller/pinctrl.c b/controller/pinctrl.c > index 428863293..9a1a0faa1 100644 > --- a/controller/pinctrl.c > +++ b/controller/pinctrl.c > @@ -4030,12 +4030,14 @@ prepare_ipv6_ras(const struct shash *local_active_ports_ras, > void > pinctrl_wait(struct ovsdb_idl_txn *ovnsb_idl_txn) > { > + ovs_mutex_lock(&pinctrl_mutex); > wait_put_mac_bindings(ovnsb_idl_txn); > wait_controller_event(ovnsb_idl_txn); > wait_put_vport_bindings(ovnsb_idl_txn); > int64_t new_seq = seq_read(pinctrl_main_seq); > seq_wait(pinctrl_main_seq, new_seq); > wait_put_fdbs(ovnsb_idl_txn); > + ovs_mutex_unlock(&pinctrl_mutex); > } > > /* Called by ovn-controller. */ >
diff --git a/controller/pinctrl.c b/controller/pinctrl.c index 428863293..9a1a0faa1 100644 --- a/controller/pinctrl.c +++ b/controller/pinctrl.c @@ -4030,12 +4030,14 @@ prepare_ipv6_ras(const struct shash *local_active_ports_ras, void pinctrl_wait(struct ovsdb_idl_txn *ovnsb_idl_txn) { + ovs_mutex_lock(&pinctrl_mutex); wait_put_mac_bindings(ovnsb_idl_txn); wait_controller_event(ovnsb_idl_txn); wait_put_vport_bindings(ovnsb_idl_txn); int64_t new_seq = seq_read(pinctrl_main_seq); seq_wait(pinctrl_main_seq, new_seq); wait_put_fdbs(ovnsb_idl_txn); + ovs_mutex_unlock(&pinctrl_mutex); } /* Called by ovn-controller. */
The function is called from main thread, and wait_* subprocedures access data structures that are managed by pinctrl thread, so make sure the access to them is guarded. Signed-off-by: Ihar Hrachyshka <ihrachys@redhat.com> --- controller/pinctrl.c | 2 ++ 1 file changed, 2 insertions(+)