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

inux-prim.c:129:25: error: dereferencing pointer to incomplete type ‘struct xa_node’

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.16.0
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      Recent commit "778791dd7d LU-8130 libcfs: don't use radix tree for xarray" breaks build on old kernel 4.17-4.19:

      make[3]: Entering directory '/usr/src/kernels/4.19.90-2308.2.0.0213.oe1.aarch64'
        CC [M]  /home/openeuler/lustre-release/libcfs/libcfs/linux/linux-prim.o
      /home/openeuler/lustre-release/libcfs/libcfs/linux/linux-prim.c: In function ‘xarray_node_ctor’:
      /home/openeuler/lustre-release/libcfs/libcfs/linux/linux-prim.c:129:25: error: dereferencing pointer to incomplete type ‘struct xa_node’
        memset(node, 0, sizeof(*node));
                               ^~~~~
      /home/openeuler/lustre-release/libcfs/libcfs/linux/linux-prim.c: In function ‘cfs_arch_init’:
      /home/openeuler/lustre-release/libcfs/libcfs/linux/linux-prim.c:143:15: error: invalid application of ‘sizeof’ to incomplete type ‘struct xa_node’
              sizeof(struct xa_node), 0,
                     ^~~~~~
      /home/openeuler/lustre-release/libcfs/libcfs/linux/linux-prim.c: At top level: 

      Attachments

        Activity

          [LU-17052] inux-prim.c:129:25: error: dereferencing pointer to incomplete type ‘struct xa_node’
          pjones Peter Jones added a comment -

          Landed for 2.16

          pjones Peter Jones added a comment - Landed for 2.16

          "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52090/
          Subject: LU-17052 libcfs: fix build for old kernel
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: 75dd69dd6ecac38267a8fbf475945b2a2f293ba9

          gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/52090/ Subject: LU-17052 libcfs: fix build for old kernel Project: fs/lustre-release Branch: master Current Patch Set: Commit: 75dd69dd6ecac38267a8fbf475945b2a2f293ba9

          "xinliang <xinliang.liu@linaro.org>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/52090
          Subject: LU-17052 libcfs: fix build for old kernel
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: faab3d6bd3d898b6e849705476318e82210a7c09

          gerrit Gerrit Updater added a comment - "xinliang <xinliang.liu@linaro.org>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/52090 Subject: LU-17052 libcfs: fix build for old kernel Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: faab3d6bd3d898b6e849705476318e82210a7c09
          xinliang Xinliang Liu added a comment -

          This break build might affect old kernel from v4.17 to v4.19. Because v4.17 adds <linux/xarray.h> and make fs.h #include  <linux/xarray.h>, v4.20 introduces full xarray support.

          The cause is that fs.h(from kernel v4.17 commit b93b016313b3) is already included <linux/xarray.h>, so #include <libcfs/linux/xarray.h> which contains the definition of 'struct xa_node'  don't take effect.

           

          cat libcfs/libcfs/linux/linux-prim.c
          ...
          #include <linux/fs.h>
          ...
          #ifndef HAVE_XARRAY_SUPPORT
          #include <libcfs/linux/xarray.h>
          #endif 

           

           

          xinliang Xinliang Liu added a comment - This break build might affect old kernel from v4.17 to v4.19. Because v4.17 adds <linux/xarray.h> and make fs.h #include  <linux/xarray.h>, v4.20 introduces full xarray support. The cause is that fs.h(from kernel v4.17 commit b93b016313b3) is already included <linux/xarray.h>, so #include <libcfs/linux/xarray.h> which contains the definition of 'struct xa_node'  don't take effect.   cat libcfs/libcfs/linux/linux-prim.c ... #include <linux/fs.h> ... #ifndef HAVE_XARRAY_SUPPORT #include <libcfs/linux/xarray.h> #endif    

          People

            xinliang Xinliang Liu
            xinliang Xinliang Liu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: