Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-6548

build errors building against recent 4.1-rc1 kernel on Ubuntu 15.04 building llibcfs/libcfs/linux/linux-cpu.c

Details

    • Bug
    • Resolution: Duplicate
    • Blocker
    • None
    • None
    • None
    • Ubuntu 13.04, with recent 4.1-rc1 kernel
    • 3
    • 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

      Attachments

        Issue Links

          Activity

            [LU-6548] build errors building against recent 4.1-rc1 kernel on Ubuntu 15.04 building llibcfs/libcfs/linux/linux-cpu.c
            green Oleg Drokin added a comment -

            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.

            green Oleg Drokin added a comment - 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.

            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>

            colinianking Colin Ian King added a comment - 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>

            People

              wc-triage WC Triage
              colinianking Colin Ian King
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: