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

James Simmons jsimmons at infradead.org
Fri Feb 7 16:30:18 PST 2025


From: Chris Horn <chris.horn at hpe.com>

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 <chris.horn at hpe.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51087
Reviewed-by: Cyril Bordage <cbordage at whamcloud.com>
Reviewed-by: Frank Sehr <fsehr at whamcloud.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 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



More information about the lustre-devel mailing list