NL_SET_ERR_MSG macros is already defined in kernels
3.10.0-1160 and above. For older kernels (3.10.0-957)
where this is not defined we put the message to the
system log as a workaround
Test-Parameters: trivial clientdistro=el7.9 serverdistro=el7.9
Test-Parameters: trivial clientdistro=el8.5 serverdistro=el8.5
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I6830e1dd2ca84df09ef89aaaa9e9b802d9cdbd16
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48916
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
#include <net/netlink.h>
#include <net/genetlink.h>
+/* NL_SET_ERR_MSG macros is already defined in kernels
+ * 3.10.0-1160 and above. For older kernels (3.10.0-957)
+ * where this is not defined we put the message to the
+ * system log as a workaround
+ */
+#ifndef NL_SET_ERR_MSG
+#define NL_SET_ERR_MSG(unused, msg) do { \
+ static const char __msg[] = msg; \
+ pr_debug("%s\n", __msg); \
+} while (0)
+#endif
+
#ifndef HAVE_NLA_STRDUP
char *nla_strdup(const struct nlattr *nla, gfp_t flags);
#endif /* !HAVE_NLA_STRDUP */