[LU-6548] build errors building against recent 4.1-rc1 kernel on Ubuntu 15.04 building llibcfs/libcfs/linux/linux-cpu.c Created: 30/Apr/15  Updated: 30/Apr/15  Resolved: 30/Apr/15

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

Type: Bug Priority: Blocker
Reporter: Colin Ian King Assignee: WC Triage
Resolution: Duplicate Votes: 0
Labels: None
Environment:

Ubuntu 13.04, with recent 4.1-rc1 kernel


Issue Links:
Related
is related to LU-6215 Sync Lustre external tree with lustre... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Kernel API changes cause libcfs/libcfs/linux/linux-cpu.c build errors:

/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c: In function ‘cfs_cpu_core_nsiblings’:
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c:99:2: error: implicit declaration of function ‘cpus_weight’ [-Werror=implicit-function-declaration]
num = cpus_weight(*cpt_data.cpt_cpumask);
^
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c: In function ‘cfs_cpt_table_print’:
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c:248:3: error: implicit declaration of function ‘for_each_cpu_mask’ [-Werror=implicit-function-declaration]
for_each_cpu_mask(j, *cptab->ctb_parts[i].cpt_cpumask) {
^
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c:248:58: error: expected ‘;’ before ‘{’ token
for_each_cpu_mask(j, *cptab->ctb_parts[i].cpt_cpumask) {
^
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c: In function ‘cfs_cpt_online’:
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c:295:9: error: implicit declaration of function ‘any_online_cpu’ [-Werror=implicit-function-declaration]
any_online_cpu(*cptab->ctb_cpumask) != NR_CPUS :
^
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c: In function ‘cfs_cpt_set_cpu’:
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c:340:2: error: implicit declaration of function ‘cpu_isset’ [-Werror=implicit-function-declaration]
LASSERT(!cpu_isset(cpu, *cptab->ctb_cpumask));
^
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c:343:2: error: implicit declaration of function ‘cpu_set’ [-Werror=implicit-function-declaration]
cpu_set(cpu, *cptab->ctb_cpumask);
^
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c: In function ‘cfs_cpt_unset_cpu’:
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c:391:2: error: implicit declaration of function ‘cpu_clear’ [-Werror=implicit-function-declaration]
cpu_clear(cpu, *cptab->ctb_parts[cpt].cpt_cpumask);
^
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c:400:59: error: expected ‘;’ before ‘{’ token
for_each_cpu_mask(i, *cptab->ctb_parts[cpt].cpt_cpumask) {
^
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c:409:44: error: expected ‘;’ before ‘{’ token
for_each_cpu_mask(i, *cptab->ctb_cpumask) {
^
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c: In function ‘cfs_cpt_set_cpumask’:
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c:433:30: error: expected ‘;’ before ‘{’ token
for_each_cpu_mask(i, *mask) {
^
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c: In function ‘cfs_cpt_unset_cpumask’:
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c:448:3: error: expected ‘;’ before ‘cfs_cpt_unset_cpu’
cfs_cpt_unset_cpu(cptab, cpt, i);
^
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c: In function ‘cfs_cpt_clear’:
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c:538:4: error: expected ‘;’ before ‘cfs_cpt_unset_cpu’
cfs_cpt_unset_cpu(cptab, cpt, i);
^
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c: In function ‘cfs_cpt_choose_ncpus’:
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c:662:3: error: implicit declaration of function ‘cpus_empty’ [-Werror=implicit-function-declaration]
while (!cpus_empty(*node)) {
^
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c:663:4: error: implicit declaration of function ‘first_cpu’ [-Werror=implicit-function-declaration]
cpu = first_cpu(*node);
^
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c:686:3: error: implicit declaration of function ‘cpus_and’ [-Werror=implicit-function-declaration]
cpus_and(*socket, *socket, *node);
^
/home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c:699:32: error: expected ‘;’ before ‘{’ token
for_each_cpu_mask(i, *core)

{ ^ /home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c: In function ‘cfs_cpt_set_cpumask’: /home/king/lustre/lustre-release/libcfs/libcfs/linux/linux-cpu.c:439:1: warning: control reaches end of non-void function [-Wreturn-type] }

^
cc1: some warnings being treated as errors



 Comments   
Comment by Colin Ian King [ 30/Apr/15 ]

The build errors are due to the following commit that removed the deprecated cpumask functions. So I guess the new API should be used now.

commit 2f0f267ea0720ec6adbe9cf7386450425fac8258
Author: Rusty Russell <rusty@rustcorp.com.au>
Date: Thu Mar 5 10:49:19 2015 +1030

cpumask: remove deprecated functions.

Using these functions with offstack cpus is unsafe. They use all NR_CPUS
bits, unstead of nr_cpumask_bits.

In particular, lustre (in staging) used cpus_ and that caused a bug.

Reported-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Comment by Oleg Drokin [ 30/Apr/15 ]

This is a dup of LU-6285, and the remaining patch for this ticket is in http://review.whamcloud.com/#/c/13926/

should land into our master tree soon.

Generated at Sat Feb 10 02:01:10 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.