diff mbox series

[12/21] lnet: udsp: lnetctl udsp improvements

Message ID 20250208003027.180076-13-jsimmons@infradead.org (mailing list archive)
State New
Headers show
Series lustre: sync to OpenSFS branch June 28, 2023 | expand

Commit Message

James Simmons Feb. 8, 2025, 12:30 a.m. UTC
From: Chris Horn <chris.horn@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@hpe.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51087
Reviewed-by: Cyril Bordage <cbordage@whamcloud.com>
Reviewed-by: Frank Sehr <fsehr@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 net/lnet/lnet/api-ni.c | 6 ------
 net/lnet/lnet/udsp.c   | 3 +++
 2 files changed, 3 insertions(+), 6 deletions(-)
diff mbox series

Patch

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;
 }