[lustre-devel] [PATCH 12/21] lnet: udsp: lnetctl udsp improvements

James Simmons <[email protected]> Fri, 7 Feb 2025 19:30:18 -0500
Newsgroups org.lustre.lists.lustre-devel
Message-ID <[email protected]>
From: Chris Horn <[email protected]>

lnet_udsp_del_policy() did not previously return non-zero, but its
single caller would check for a non-zero and call
lnet_udsp_apply_policies(). This code is removed.
lnet_udsp_del_policy() will now return non-zero but only in the case
where there is no matching policy index. In this case the policies
are not modified and thus we needn't re-apply them.

HPE-bug-id: LUS-11490
WC-bug-id: https://jira.whamcloud.com/browse/LU-16574
Lustre-commit: 9e6c0915bb73a04e2 ("LU-16574 udsp: lnetctl udsp improvements")
Signed-off-by: Chris Horn <[email protected]>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51087
Reviewed-by: Cyril Bordage <[email protected]>
Reviewed-by: Frank Sehr <[email protected]>
Reviewed-by: Oleg Drokin <[email protected]>
Signed-off-by: James Simmons <[email protected]>
---
 net/lnet/lnet/api-ni.c | 6 ------
 net/lnet/lnet/udsp.c   | 3 +++
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/net/lnet/lnet/api-ni.c b/net/lnet/lnet/api-ni.c
index d3d51acdf2ad..6884c5d3ad86 100644
--- a/net/lnet/lnet/api-ni.c
+++ b/net/lnet/lnet/api-ni.c
@@ -4550,12 +4550,6 @@ LNetCtl(unsigned int cmd, void *arg)
 
 		mutex_lock(&the_lnet.ln_api_mutex);
 		rc = lnet_udsp_del_policy(idx);
-		if (!rc) {
-			rc = lnet_udsp_apply_policies(NULL, false);
-			CDEBUG(D_NET, "policy re-application returned %d\n",
-			       rc);
-			rc = 0;
-		}
 		mutex_unlock(&the_lnet.ln_api_mutex);
 
 		return rc;
diff --git a/net/lnet/lnet/udsp.c b/net/lnet/lnet/udsp.c
index eb9a614a0ec1..9f6ff5baf118 100644
--- a/net/lnet/lnet/udsp.c
+++ b/net/lnet/lnet/udsp.c
@@ -982,6 +982,9 @@ lnet_udsp_del_policy(int idx)
 		}
 	}
 
+	if (!removed)
+		return -ENOENT;
+
 	return 0;
 }
 
-- 
2.39.3

_______________________________________________
lustre-devel mailing list
[email protected]
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org