Whamcloud - gitweb
LU-15420 build: fixes to support building on Ubuntu 22.04 LTS 50/47750/3
authorJames Simmons <jsimmons@infradead.org>
Fri, 24 Jun 2022 06:12:20 +0000 (23:12 -0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 6 Jul 2022 03:37:37 +0000 (03:37 +0000)
commit0a81f499fdc48047e6c95b4629e108eafd220cbd
treec347a469658fc8db0c88748c7ecdf8350e09f9b5
parentfeba0e67fe819e9a3f1cb154f9d324c3ac28e7e4
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.

Lustre-change: https://review.whamcloud.com/47133
Lustre-commit: c04adbcd76725a360f411f09c63df785bf7db426

Test-Parameters: trivial
Change-Id: Ib5985b187c3013fbc513e9962a5f27bed4996f5b
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/47750
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/autoconf/lustre-libcfs.m4
libcfs/include/libcfs/linux/linux-misc.h
lustre/include/lu_object.h
lustre/target/update_trans.c