[LU-16241] Kernel 3.10 Build Fail on Master (3ffcb5b70) with NL_SET_ERR_MSG not defined Created: 17/Oct/22  Updated: 02/Nov/22  Resolved: 02/Nov/22

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.16.0

Type: Bug Priority: Minor
Reporter: Arshad Hussain Assignee: Arshad Hussain
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-9680 Improve the user land to kernel space... In Progress
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Master is at: 3ffcb5b70

Kernel : 3.10

Build falied with:

 

make[3]: Entering directory `/usr/src/kernels/3.10.0-957.el7_lustre.x86_64'
  CC [M]  /root/mrp/lustre-xx-3.10/lustre-release/lustre/obdclass/kernelcomm.o
  CC [M]  /root/mrp/lustre-xx-3.10/lustre-release/lustre/osp/osp_dev.o
/root/mrp/lustre-xx-3.10/lustre-release/lustre/obdclass/kernelcomm.c: In function ‘lustre_device_list_start’:
/root/mrp/lustre-xx-3.10/lustre-release/lustre/obdclass/kernelcomm.c:151:4: error: implicit declaration of function ‘NL_SET_ERR_MSG’ [-Werror=implicit-function-declaration]
    NL_SET_ERR_MSG(extack, "No devices found");
    ^
/root/mrp/lustre-xx-3.10/lustre-release/lustre/obdclass/kernelcomm.c:151:19: error: ‘extack’ undeclared (first use in this function)
    NL_SET_ERR_MSG(extack, "No devices found");
                   ^
/root/mrp/lustre-xx-3.10/lustre-release/lustre/obdclass/kernelcomm.c:151:19: note: each undeclared identifier is reported only once for each function it appears in
/root/mrp/lustre-xx-3.10/lustre-release/lustre/obdclass/kernelcomm.c: In function ‘lustre_device_list_dump’:
/root/mrp/lustre-xx-3.10/lustre-release/lustre/obdclass/kernelcomm.c:188:19: error: ‘extack’ undeclared (first use in this function)
    NL_SET_ERR_MSG(extack, "failed to send key table");
 

 

Looks like NL_SET_ERR_MSG is defined under net/genetlink.h after 4.x kernel. Not available under 3.X kernel. Works on 4.18



 Comments   
Comment by James A Simmons [ 17/Oct/22 ]

can you check kernel/include/linux/netlink.h for the MACRO.

Its defined as such on RHEL7

 

/* RHEL: Specific implementation of NL_SET_ERR_MSG* macros. Due to absence of

  • ext-ack support in RHEL7 the macros don't pass the error message to caller
  • and instead of this they simply put the message to the system log.
  • To avoid flooding of the log macro pr_debug() is used and the error messages
  • can be enabled or disabled via dynamic_debug in sysfs.
    */
    #define NL_SET_ERR_MSG(unused, msg) do {                \        static const char __msg[] = msg;                \        pr_debug("%s\n", __msg);                        \ }

    while(0)

Maybe it was moved elsewhere.

Comment by Gerrit Updater [ 19/Oct/22 ]

"Arshad Hussain <arshad.hussain@aeoncomputing.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/48916
Subject: LU-16241 obdclass: NL_SET_ERR_MSG work for older kernel
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: a70a2f63c38e1cb49380986026eac025bbd75005

Comment by Gerrit Updater [ 02/Nov/22 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/48916/
Subject: LU-16241 obdclass: NL_SET_ERR_MSG work for older kernel
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: d41a508a4958b9edb104ee0076fd29d0f2196845

Comment by Peter Jones [ 02/Nov/22 ]

Landed for 2.16

Generated at Sat Feb 10 03:25:15 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.