stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "net/mlx5: Fix error handling when adding flow rules" has been added to the 4.15-stable tree
@ 2018-03-07  3:31 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2018-03-07  3:31 UTC (permalink / raw)
  To: vladbu, gregkh, maorg, saeedm; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    net/mlx5: Fix error handling when adding flow rules

to the 4.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-mlx5-fix-error-handling-when-adding-flow-rules.patch
and it can be found in the queue-4.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Tue Mar  6 19:02:56 PST 2018
From: Vlad Buslov <vladbu@mellanox.com>
Date: Tue, 6 Feb 2018 10:52:19 +0200
Subject: net/mlx5: Fix error handling when adding flow rules

From: Vlad Buslov <vladbu@mellanox.com>


[ Upstream commit 9238e380e823a39983ee8d6b6ee8d1a9c4ba8a65 ]

If building match list or adding existing fg fails when
node is locked, function returned without unlocking it.
This happened if node version changed or adding existing fg
returned with EAGAIN after jumping to search_again_locked label.

Fixes: bd71b08ec2ee ("net/mlx5: Support multiple updates of steering rules in parallel")
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Reviewed-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -1755,8 +1755,11 @@ search_again_locked:
 
 	/* Collect all fgs which has a matching match_criteria */
 	err = build_match_list(&match_head, ft, spec);
-	if (err)
+	if (err) {
+		if (take_write)
+			up_write_ref_node(&ft->node);
 		return ERR_PTR(err);
+	}
 
 	if (!take_write)
 		up_read_ref_node(&ft->node);
@@ -1765,8 +1768,11 @@ search_again_locked:
 				      dest_num, version);
 	free_match_list(&match_head);
 	if (!IS_ERR(rule) ||
-	    (PTR_ERR(rule) != -ENOENT && PTR_ERR(rule) != -EAGAIN))
+	    (PTR_ERR(rule) != -ENOENT && PTR_ERR(rule) != -EAGAIN)) {
+		if (take_write)
+			up_write_ref_node(&ft->node);
 		return rule;
+	}
 
 	if (!take_write) {
 		nested_down_write_ref_node(&ft->node, FS_LOCK_GRANDPARENT);


Patches currently in stable-queue which might be from vladbu@mellanox.com are

queue-4.15/net-mlx5-fix-error-handling-when-adding-flow-rules.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-07  3:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-07  3:31 Patch "net/mlx5: Fix error handling when adding flow rules" has been added to the 4.15-stable tree gregkh

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).