From: Paolo Abeni <pabeni@redhat.com>
To: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Pravin B Shelar <pshelar@ovn.org>
Subject: [PATCH net 2/2] openvswitch: remove another BUG_ON()
Date: Tue, 26 Nov 2019 13:10:30 +0100 [thread overview]
Message-ID: <ce4855580a312e982f9394fee6762a31663bbf5e.1574769406.git.pabeni@redhat.com> (raw)
In-Reply-To: <cover.1574769406.git.pabeni@redhat.com>
If we can't build the flow del notification, we can simply delete
the flow, no need to crash the kernel. Still keep a WARN_ON to
preserve debuggability.
Note: the BUG_ON() predates the Fixes tag, but this change
can be applied only after the mentioned commit.
Fixes: aed067783e50 ("openvswitch: Minimize ovs_flow_cmd_del critical section.")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
net/openvswitch/datapath.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index e94f675794f1..50656e807c8c 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -1346,7 +1346,8 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct genl_info *info)
OVS_FLOW_CMD_DEL,
ufid_flags);
rcu_read_unlock();
- BUG_ON(err < 0);
+ if (WARN_ON_ONCE(err < 0))
+ goto out_free;
ovs_notify(&dp_flow_genl_family, reply, info);
} else {
@@ -1354,6 +1355,7 @@ static int ovs_flow_cmd_del(struct sk_buff *skb, struct genl_info *info)
}
}
+out_free:
ovs_flow_free(flow, true);
return 0;
unlock:
--
2.21.0
prev parent reply other threads:[~2019-11-26 12:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-26 12:10 [PATCH net 0/2] openvswitch: remove a couple of BUG_ON() Paolo Abeni
2019-11-26 12:10 ` [PATCH net 1/2] openvswitch: drop unneeded BUG_ON() in ovs_flow_cmd_build_info() Paolo Abeni
2019-11-27 10:07 ` Sergei Shtylyov
2019-11-28 21:17 ` David Miller
2019-11-29 10:16 ` Paolo Abeni
2019-11-26 12:10 ` Paolo Abeni [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ce4855580a312e982f9394fee6762a31663bbf5e.1574769406.git.pabeni@redhat.com \
--to=pabeni@redhat.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=pshelar@ovn.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).