[lustre-devel] [PATCH 21/25] lnet: restore IOC_LIBCFS_GET_NI
James Simmons
jsimmons at infradead.org
Thu Jan 30 06:11:11 PST 2025
Restore IOC_LIBCFS_GET_NI for compatibility until there have been
some releases with netlink support, so that older utilities just
work.
Fixes: fafd24988 ("lnet: use Netlink to support old and new NI APIs.")
WC-bug-id: https://jira.whamcloud.com/browse/LU-16462
Lustre-commit: ae1ee11cea0a90631 ("LU-16462 utils: handle lack of newer nla_attrs")
Signed-off-by: James Simmons <jsimmons at infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49608
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-by: Frank Sehr <fsehr at whamcloud.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
---
include/uapi/linux/lnet/libcfs_ioctl.h | 2 +-
net/lnet/lnet/api-ni.c | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/lnet/libcfs_ioctl.h b/include/uapi/linux/lnet/libcfs_ioctl.h
index e012532fc88a..a77a736c1107 100644
--- a/include/uapi/linux/lnet/libcfs_ioctl.h
+++ b/include/uapi/linux/lnet/libcfs_ioctl.h
@@ -94,7 +94,7 @@ struct libcfs_ioctl_data {
#define IOC_LIBCFS_MARK_DEBUG _IOWR('e', 32, IOCTL_LIBCFS_TYPE)
/* IOC_LIBCFS_MEMHOG obsolete in 2.8.0, was _IOWR('e', 36, IOCTL_LIBCFS_TYPE) */
/* lnet ioctls */
-/* IOC_LIBCFS_GET_NI obsolete in 2.16, was _IOWR('e', 50, IOCTL_LIBCFS_TYPE) */
+#define IOC_LIBCFS_GET_NI _IOWR('e', 50, IOCTL_LIBCFS_TYPE)
#define IOC_LIBCFS_FAIL_NID _IOWR('e', 51, IOCTL_LIBCFS_TYPE)
#define IOC_LIBCFS_NOTIFY_ROUTER _IOWR('e', 55, IOCTL_LIBCFS_TYPE)
#define IOC_LIBCFS_UNCONFIGURE _IOWR('e', 56, IOCTL_LIBCFS_TYPE)
diff --git a/net/lnet/lnet/api-ni.c b/net/lnet/lnet/api-ni.c
index f3f9aeef04dd..5ec6faa2da98 100644
--- a/net/lnet/lnet/api-ni.c
+++ b/net/lnet/lnet/api-ni.c
@@ -4030,6 +4030,13 @@ LNetCtl(unsigned int cmd, void *arg)
sizeof(struct lnet_ioctl_config_data));
switch (cmd) {
+ case IOC_LIBCFS_GET_NI: {
+ struct lnet_processid id = {};
+
+ rc = LNetGetId(data->ioc_count, &id);
+ data->ioc_nid = lnet_nid_to_nid4(&id.nid);
+ return rc;
+ }
case IOC_LIBCFS_FAIL_NID:
return lnet_fail_nid(data->ioc_nid, data->ioc_count);
--
2.39.3
More information about the lustre-devel
mailing list