Whamcloud - gitweb
LU-15420 build: fixes to support building on Ubuntu 22.04 LTS 33/47133/3
authorJames Simmons <jsimmons@infradead.org>
Mon, 25 Apr 2022 17:42:32 +0000 (13:42 -0400)
committerJames Simmons <jsimmons@infradead.org>
Mon, 25 Apr 2022 17:42:32 +0000 (13:42 -0400)
commit6b096f55bad9bd169b2aa01237764cf97b58ee56
treec88d771b3a9832d08811f682cad314aca6c8b46c
parentc6cf295d8ffc2923ee0e33d9a195bc4ee778c5b0
LU-15420 build: fixes to support building on Ubuntu 22.04 LTS

Lustre uses the glibc stdarg.h instead of the kernel's version which
causes the following build issue.

lustre/include/lu_object.h:35,
/usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h:52: note: this is the
location of the previous definition
        #define va_copy(d,s)    __builtin_va_copy(d,s)

The solution is to use the kernels version of stdarg.h

The second build issue :
update_trans.c:1608:30: error: ‘struct task_struct’ has no member named
                        ‘state’; did you mean ‘__state’?

is due Linux commit 2f064a59a11ff9bc22e52e9678bc601404c7cb34
(sched: Change task_struct::state). The state field was
changed and the barrier macros READ_ONCE()/WRITE_ONCE()
are used to access it now which is the proper thing to do.
Since the check in update_trans.c is equivalent to testing
if the kernel thread is not running, since TASK_RUNNING == 0,
we can just change the code to use task_is_running(). The
task_is_running() was introduced in 5.13.

Test-Parameters: trivial
Change-Id: Ib5985b187c3013fbc513e9962a5f27bed4996f5b
Signed-off-by: James Simmons <jsimmons@infradead.org>
libcfs/autoconf/lustre-libcfs.m4
libcfs/include/libcfs/linux/linux-misc.h
lustre/include/lu_object.h
lustre/target/update_trans.c