Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux 4.19] error: passing argument 1 of 'refcount_inc' in blkcg_cgwb_get and blkcg_cgwb_put #7885

Closed
philmmanjaro opened this issue Sep 11, 2018 · 2 comments
Labels
Type: Building Indicates an issue related to building binaries
Milestone

Comments

@philmmanjaro
Copy link

System information

Type Version/Name
Distribution Name Manjaro
Distribution Version 18.0-beta
Linux Kernel 4.19-rc3+
Architecture x86_64
ZFS Version 0.7.10
SPL Version 0.7.10

Describe the problem you're observing

torvalds/linux@59b5771 introduced following error: passing argument 1 of 'refcount_inc' from incompatible pointer type [-Werror=incompatible-pointer-types] refcount_inc(&blkcg->cgwb_refcnt);

Describe how to reproduce the problem

Try to compile zfs with 4.19-rc3 and higher

Include any warning/errors/backtraces from the system logs

  CC [M]  spl_zfs/src/zfs-0.7.10/module/icp/core/kcf_callprov.o
In file included from ./include/linux/backing-dev.h:17,
                 from spl_zfs/src/zfs-0.7.10/include/linux/blkdev_compat.h:34,
                 from spl_zfs/src/zfs-0.7.10/include/sys/dmu.h:759,
                 from spl_zfs/src/zfs-0.7.10/module/zpios/pios.c:37:
./include/linux/blk-cgroup.h: In function 'blkcg_cgwb_get':
In file included from ./include/linux/backing-dev.h:17,
                 from spl_zfs/src/zfs-0.7.10/include/linux/blkdev_compat.h:34,
                 from spl_zfs/src/zfs-0.7.10/include/sys/dmu.h:759,
                 from spl_zfs/src/zfs-0.7.10/include/sys/dsl_deleg.h:29,
                 from spl_zfs/src/zfs-0.7.10/module/zcommon/zfs_deleg.c:41:
./include/linux/blk-cgroup.h: In function 'blkcg_cgwb_get':
./include/linux/blk-cgroup.h:402:15: error: passing argument 1 of 'refcount_inc' from incompatible pointer type [-Werror=incompatible-pointer-types]
  refcount_inc(&blkcg->cgwb_refcnt);
               ^~~~~~~~~~~~~~~~~~~
./include/linux/blk-cgroup.h:402:15: error: passing argument 1 of 'refcount_inc' from incompatible pointer type [-Werror=incompatible-pointer-types]
  refcount_inc(&blkcg->cgwb_refcnt);
               ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/refcount.h:72,
                 from ./include/linux/kref.h:19,
                 from ./include/linux/kobject.h:23,
                 from ./include/linux/module.h:17,
                 from spl_zfs/src/spl-spl-0.7.10/include/sys/sysmacros.h:28,
                 from spl_zfs/src/spl-spl-0.7.10/include/sys/types.h:29,
                 from spl_zfs/src/zfs-0.7.10/include/sys/zfs_context.h:34,
                 from spl_zfs/src/zfs-0.7.10/module/zcommon/zfs_deleg.c:28:
./arch/x86/include/asm/refcount.h:51:54: note: expected 'refcount_t *' {aka 'struct refcount_struct *'} but argument is of type 'zfs_refcount_t *' {aka 'struct refcount *'}
 static __always_inline void refcount_inc(refcount_t *r)
                                          ~~~~~~~~~~~~^
In file included from ./include/linux/refcount.h:72,
                 from ./include/linux/kref.h:19,
                 from ./include/linux/kobject.h:23,
                 from ./include/linux/module.h:17,
                 from spl_zfs/src/spl-spl-0.7.10/include/sys/sysmacros.h:28,
                 from spl_zfs/src/spl-spl-0.7.10/include/sys/types.h:29,
                 from spl_zfs/src/zfs-0.7.10/include/sys/zfs_context.h:34,
                 from spl_zfs/src/zfs-0.7.10/module/zpios/pios.c:36:
./arch/x86/include/asm/refcount.h:51:54: note: expected 'refcount_t *' {aka 'struct refcount_struct *'} but argument is of type 'zfs_refcount_t *' {aka 'struct refcount *'}
 static __always_inline void refcount_inc(refcount_t *r)
                                          ~~~~~~~~~~~~^
In file included from ./include/linux/backing-dev.h:17,
                 from spl_zfs/src/zfs-0.7.10/include/linux/blkdev_compat.h:34,
                 from spl_zfs/src/zfs-0.7.10/include/sys/dmu.h:759,
                 from spl_zfs/src/zfs-0.7.10/module/zpios/pios.c:37:
./include/linux/blk-cgroup.h: In function 'blkcg_cgwb_put':
In file included from ./include/linux/backing-dev.h:17,
                 from spl_zfs/src/zfs-0.7.10/include/linux/blkdev_compat.h:34,
                 from spl_zfs/src/zfs-0.7.10/include/sys/dmu.h:759,
                 from spl_zfs/src/zfs-0.7.10/include/sys/dsl_deleg.h:29,
                 from spl_zfs/src/zfs-0.7.10/module/zcommon/zfs_deleg.c:41:
./include/linux/blk-cgroup.h: In function 'blkcg_cgwb_put':
./include/linux/blk-cgroup.h:417:28: error: passing argument 1 of 'refcount_dec_and_test' from incompatible pointer type [-Werror=incompatible-pointer-types]
  if (refcount_dec_and_test(&blkcg->cgwb_refcnt))
                            ^~~~~~~~~~~~~~~~~~~
./include/linux/blk-cgroup.h:417:28: error: passing argument 1 of 'refcount_dec_and_test' from incompatible pointer type [-Werror=incompatible-pointer-types]
  if (refcount_dec_and_test(&blkcg->cgwb_refcnt))
                            ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/refcount.h:72,
                 from ./include/linux/kref.h:19,
                 from ./include/linux/kobject.h:23,
                 from ./include/linux/module.h:17,
                 from spl_zfs/src/spl-spl-0.7.10/include/sys/sysmacros.h:28,
                 from spl_zfs/src/spl-spl-0.7.10/include/sys/types.h:29,
                 from spl_zfs/src/zfs-0.7.10/include/sys/zfs_context.h:34,
                 from spl_zfs/src/zfs-0.7.10/module/zpios/pios.c:36:
./arch/x86/include/asm/refcount.h:74:76: note: expected 'refcount_t *' {aka 'struct refcount_struct *'} but argument is of type 'zfs_refcount_t *' {aka 'struct refcount *'}
 static __always_inline __must_check bool refcount_dec_and_test(refcount_t *r)
                                                                ~~~~~~~~~~~~^
In file included from ./include/linux/refcount.h:72,
                 from ./include/linux/kref.h:19,
                 from ./include/linux/kobject.h:23,
                 from ./include/linux/module.h:17,
                 from spl_zfs/src/spl-spl-0.7.10/include/sys/sysmacros.h:28,
                 from spl_zfs/src/spl-spl-0.7.10/include/sys/types.h:29,
                 from spl_zfs/src/zfs-0.7.10/include/sys/zfs_context.h:34,
                 from spl_zfs/src/zfs-0.7.10/module/zcommon/zfs_deleg.c:28:
./arch/x86/include/asm/refcount.h:74:76: note: expected 'refcount_t *' {aka 'struct refcount_struct *'} but argument is of type 'zfs_refcount_t *' {aka 'struct refcount *'}
 static __always_inline __must_check bool refcount_dec_and_test(refcount_t *r)
                                                                ~~~~~~~~~~~~^
In file included from ./include/linux/backing-dev.h:17,
                 from spl_zfs/src/zfs-0.7.10/include/linux/blkdev_compat.h:34,
                 from spl_zfs/src/zfs-0.7.10/include/sys/dmu.h:759,
                 from spl_zfs/src/zfs-0.7.10/include/sys/spa.h:43,
                 from spl_zfs/src/zfs-0.7.10/include/sys/zio.h:36,
                 from spl_zfs/src/zfs-0.7.10/module/zcommon/zfs_prop.c:30:
./include/linux/blk-cgroup.h: In function 'blkcg_cgwb_get':
./include/linux/blk-cgroup.h:402:15: error: passing argument 1 of 'refcount_inc' from incompatible pointer type [-Werror=incompatible-pointer-types]
  refcount_inc(&blkcg->cgwb_refcnt);
               ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/refcount.h:72,
                 from ./include/linux/kref.h:19,
                 from ./include/linux/kobject.h:23,
                 from ./include/linux/module.h:17,
                 from spl_zfs/src/spl-spl-0.7.10/include/sys/sysmacros.h:28,
                 from spl_zfs/src/spl-spl-0.7.10/include/sys/types.h:29,
                 from spl_zfs/src/zfs-0.7.10/include/sys/zfs_context.h:34,
                 from spl_zfs/src/zfs-0.7.10/include/sys/zio.h:35,
                 from spl_zfs/src/zfs-0.7.10/module/zcommon/zfs_prop.c:30:
./arch/x86/include/asm/refcount.h:51:54: note: expected 'refcount_t *' {aka 'struct refcount_struct *'} but argument is of type 'zfs_refcount_t *' {aka 'struct refcount *'}
 static __always_inline void refcount_inc(refcount_t *r)
                                          ~~~~~~~~~~~~^
In file included from ./include/linux/backing-dev.h:17,
                 from spl_zfs/src/zfs-0.7.10/include/linux/blkdev_compat.h:34,
                 from spl_zfs/src/zfs-0.7.10/include/sys/dmu.h:759,
                 from spl_zfs/src/zfs-0.7.10/include/sys/spa.h:43,
                 from spl_zfs/src/zfs-0.7.10/include/sys/zio.h:36,
                 from spl_zfs/src/zfs-0.7.10/module/zcommon/zfs_prop.c:30:
./include/linux/blk-cgroup.h: In function 'blkcg_cgwb_put':
./include/linux/blk-cgroup.h:417:28: error: passing argument 1 of 'refcount_dec_and_test' from incompatible pointer type [-Werror=incompatible-pointer-types]
  if (refcount_dec_and_test(&blkcg->cgwb_refcnt))
                            ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/refcount.h:72,
                 from ./include/linux/kref.h:19,
                 from ./include/linux/kobject.h:23,
                 from ./include/linux/module.h:17,
                 from spl_zfs/src/spl-spl-0.7.10/include/sys/sysmacros.h:28,
                 from spl_zfs/src/spl-spl-0.7.10/include/sys/types.h:29,
                 from spl_zfs/src/zfs-0.7.10/include/sys/zfs_context.h:34,
                 from spl_zfs/src/zfs-0.7.10/include/sys/zio.h:35,
                 from spl_zfs/src/zfs-0.7.10/module/zcommon/zfs_prop.c:30:
./arch/x86/include/asm/refcount.h:74:76: note: expected 'refcount_t *' {aka 'struct refcount_struct *'} but argument is of type 'zfs_refcount_t *' {aka 'struct refcount *'}
 static __always_inline __must_check bool refcount_dec_and_test(refcount_t *r)
                                                                ~~~~~~~~~~~~^
In file included from ./include/linux/backing-dev.h:17,
                 from spl_zfs/src/zfs-0.7.10/include/linux/blkdev_compat.h:34,
                 from spl_zfs/src/zfs-0.7.10/include/sys/dmu.h:759,
                 from spl_zfs/src/zfs-0.7.10/include/sys/spa.h:43,
                 from spl_zfs/src/zfs-0.7.10/include/sys/zio.h:36,
                 from spl_zfs/src/zfs-0.7.10/module/zfs/abd.c:119:
./include/linux/blk-cgroup.h: In function 'blkcg_cgwb_get':
./include/linux/blk-cgroup.h:402:15: error: passing argument 1 of 'refcount_inc' from incompatible pointer type [-Werror=incompatible-pointer-types]
  refcount_inc(&blkcg->cgwb_refcnt);
               ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/refcount.h:72,
                 from ./include/linux/kref.h:19,
                 from ./include/linux/kobject.h:23,
                 from ./include/linux/module.h:17,
                 from spl_zfs/src/spl-spl-0.7.10/include/sys/sysmacros.h:28,
                 from spl_zfs/src/spl-spl-0.7.10/include/sys/types.h:29,
                 from spl_zfs/src/spl-spl-0.7.10/include/sys/list.h:28,
                 from spl_zfs/src/zfs-0.7.10/include/sys/refcount.h:30,
                 from spl_zfs/src/zfs-0.7.10/include/sys/abd.h:32,
                 from spl_zfs/src/zfs-0.7.10/module/zfs/abd.c:117:
./arch/x86/include/asm/refcount.h:51:54: note: expected 'refcount_t *' {aka 'struct refcount_struct *'} but argument is of type 'zfs_refcount_t *' {aka 'struct refcount *'}
 static __always_inline void refcount_inc(refcount_t *r)
                                          ~~~~~~~~~~~~^
In file included from ./include/linux/backing-dev.h:17,
                 from spl_zfs/src/zfs-0.7.10/include/linux/blkdev_compat.h:34,
                 from spl_zfs/src/zfs-0.7.10/include/sys/dmu.h:759,
                 from spl_zfs/src/zfs-0.7.10/include/sys/spa.h:43,
                 from spl_zfs/src/zfs-0.7.10/include/sys/zio.h:36,
                 from spl_zfs/src/zfs-0.7.10/module/zfs/abd.c:119:
./include/linux/blk-cgroup.h: In function 'blkcg_cgwb_put':
./include/linux/blk-cgroup.h:417:28: error: passing argument 1 of 'refcount_dec_and_test' from incompatible pointer type [-Werror=incompatible-pointer-types]
  if (refcount_dec_and_test(&blkcg->cgwb_refcnt))
                            ^~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/refcount.h:72,
                 from ./include/linux/kref.h:19,
                 from ./include/linux/kobject.h:23,
                 from ./include/linux/module.h:17,
                 from spl_zfs/src/spl-spl-0.7.10/include/sys/sysmacros.h:28,
                 from spl_zfs/src/spl-spl-0.7.10/include/sys/types.h:29,
                 from spl_zfs/src/spl-spl-0.7.10/include/sys/list.h:28,
                 from spl_zfs/src/zfs-0.7.10/include/sys/refcount.h:30,
                 from spl_zfs/src/zfs-0.7.10/include/sys/abd.h:32,
                 from spl_zfs/src/zfs-0.7.10/module/zfs/abd.c:117:
./arch/x86/include/asm/refcount.h:74:76: note: expected 'refcount_t *' {aka 'struct refcount_struct *'} but argument is of type 'zfs_refcount_t *' {aka 'struct refcount *'}
 static __always_inline __must_check bool refcount_dec_and_test(refcount_t *r)
                                                                ~~~~~~~~~~~~^
  CC [M]  spl_zfs/src/zfs-0.7.10/module/icp/core/kcf_prov_tabs.o
cc1: some warnings being treated as errors
  LD [M]  spl_zfs/src/zfs-0.7.10/module/avl/zavl.o
make[5]: *** [scripts/Makefile.build:306: spl_zfs/src/zfs-0.7.10/module/zcommon/zfs_deleg.o] Error 1
make[5]: *** Waiting for unfinished jobs....
  CC [M]  spl_zfs/src/zfs-0.7.10/module/zcommon/zprop_common.o
  CC [M]  spl_zfs/src/zfs-0.7.10/module/zfs/arc.o
cc1: some warnings being treated as errors
make[5]: *** [scripts/Makefile.build:306: spl_zfs/src/zfs-0.7.10/module/zcommon/zfs_prop.o] Error 1
  CC [M]  spl_zfs/src/zfs-0.7.10/module/zfs/blkptr.o
  CC [M]  spl_zfs/src/zfs-0.7.10/module/icp/core/kcf_sched.o
cc1: some warnings being treated as errors
cc1: some warnings being treated as errors
make[5]: *** [scripts/Makefile.build:306: spl_zfs/src/zfs-0.7.10/module/zpios/pios.o] Error 1
make[4]: *** [scripts/Makefile.build:546: spl_zfs/src/zfs-0.7.10/module/zpios] Error 2
@behlendorf behlendorf added the Type: Building Indicates an issue related to building binaries label Sep 12, 2018
@behlendorf behlendorf added this to the 0.8.0 milestone Sep 12, 2018
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Oct 31, 2018
torvalds/linux@59b57717f ("blkcg: delay blkg destruction until
after writeback has finished") added a refcount_t to the blkcg
structure. Due to the refcount_t compatibility code, zfs_refcount_t
was used by mistake.

Resolve this by removing the compatibility code and replacing the
occurrences of refcount_t with zfs_refcount_t.

Reviewed-by: Franz Pletz <fpletz@fnordicwalking.de>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Schumacher <timschumi@gmx.de>
Closes openzfs#7885
Closes openzfs#7932
wichmannpas pushed a commit to wichmannpas/zfs that referenced this issue Nov 3, 2018
torvalds/linux@59b57717f ("blkcg: delay blkg destruction until
after writeback has finished") added a refcount_t to the blkcg
structure. Due to the refcount_t compatibility code, zfs_refcount_t
was used by mistake.

Resolve this by removing the compatibility code and replacing the
occurrences of refcount_t with zfs_refcount_t.

Reviewed-by: Franz Pletz <fpletz@fnordicwalking.de>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Schumacher <timschumi@gmx.de>
Closes openzfs#7885 
Closes openzfs#7932
@sunilvaltix
Copy link

Any plans of backporting this to 0.7? Or is it too intrusive a surgery to perform on 0.7.11?

tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Nov 5, 2018
torvalds/linux@59b57717f ("blkcg: delay blkg destruction until
after writeback has finished") added a refcount_t to the blkcg
structure. Due to the refcount_t compatibility code, zfs_refcount_t
was used by mistake.

Resolve this by removing the compatibility code and replacing the
occurrences of refcount_t with zfs_refcount_t.

Reviewed-by: Franz Pletz <fpletz@fnordicwalking.de>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Schumacher <timschumi@gmx.de>
Closes openzfs#7885
Closes openzfs#7932
tonyhutter pushed a commit that referenced this issue Nov 13, 2018
torvalds/linux@59b57717f ("blkcg: delay blkg destruction until
after writeback has finished") added a refcount_t to the blkcg
structure. Due to the refcount_t compatibility code, zfs_refcount_t
was used by mistake.

Resolve this by removing the compatibility code and replacing the
occurrences of refcount_t with zfs_refcount_t.

Reviewed-by: Franz Pletz <fpletz@fnordicwalking.de>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Schumacher <timschumi@gmx.de>
Closes #7885
Closes #7932
GregorKopka pushed a commit to GregorKopka/zfs that referenced this issue Jan 7, 2019
torvalds/linux@59b57717f ("blkcg: delay blkg destruction until
after writeback has finished") added a refcount_t to the blkcg
structure. Due to the refcount_t compatibility code, zfs_refcount_t
was used by mistake.

Resolve this by removing the compatibility code and replacing the
occurrences of refcount_t with zfs_refcount_t.

Reviewed-by: Franz Pletz <fpletz@fnordicwalking.de>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tim Schumacher <timschumi@gmx.de>
Closes openzfs#7885 
Closes openzfs#7932
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Building Indicates an issue related to building binaries
Projects
None yet
Development

No branches or pull requests

4 participants
@behlendorf @philmmanjaro @sunilvaltix and others