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

type refcount_t added to linux kernel 4.11 conflicts with zfs-defined type #5823

Closed
ofaaland opened this issue Feb 23, 2017 · 1 comment
Closed

Comments

@ofaaland
Copy link
Contributor

ofaaland commented Feb 23, 2017

System information

Type Version/Name
Distribution Name
Distribution Version
Linux Kernel 4.11
Architecture
ZFS Version master
SPL Version master

Describe the problem you're observing

Both kernel.org builders are failing to build every zfs patch. ZFS defines refcount_t but the kernel has already defined that identifier.

Describe how to reproduce the problem

Build master against torvalds/linux after Feb 20 2017 when
commit f405df5 refcount_t: Introduce a special purpose refcount type
was merged with commit 42e1b14

Include any warning/errors/backtraces from the system logs

 } refcount_t;
   ^
In file included from ./include/linux/kref.h:19:0,
                 from ./include/linux/kobject.h:24,
                 from ./include/linux/module.h:17,
                 from ./include/spl/sys/sysmacros.h:28,
                 from ./include/spl/sys/types.h:29,
                 from ./include/zfs/sys/zfs_context.h:34,
                 from fs/zfs/zcommon/zfs_deleg.c:28:
./include/linux/refcount.h:55:3: note: previous declaration of ‘refcount_t’ was here
 } refcount_t;
   ^
@ofaaland
Copy link
Contributor Author

ofaaland commented Feb 23, 2017

linux kernel defines refcount_t in new file include/linux/refcount.h:

typedef struct refcount_struct {
       atomic_t refs;
} refcount_t;

guarded by _LINUX_REFCOUNT_H

ofaaland added a commit to ofaaland/zfs that referenced this issue Feb 23, 2017
This patch is purely to trigger the buildbot to build and test
against SPL pull request 606:

See openzfs#5823

Requires-spl: refs/pull/606/head

Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
ofaaland added a commit to ofaaland/zfs that referenced this issue Feb 27, 2017
Linux 4.11 introduces a new type, refcount_t, which conflicts with the
type of the same name defined within ZFS.

Since the ZFS code never refers to the linux type, the ZFS type can be
renamed.

Rather than touching all the ZFS code that uses refcount_t, rename the
type at compile time to zfs_refcount_t via a #define macro.

Fixes openzfs#5823

Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
ofaaland added a commit to ofaaland/zfs that referenced this issue Feb 27, 2017
Linux 4.11 introduces a new type, refcount_t, which conflicts with the
type of the same name defined within ZFS.

Rename the ZFS type zfs_refcount_t.  Within the ZFS code, use a macro to
cause references to refcount_t to be changed to zfs_refcount_t at
compile time.  This reduces conflicts when later landing OpenZFS
patches.

Fixes openzfs#5823

Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
ofaaland added a commit to ofaaland/zfs that referenced this issue Feb 27, 2017
Linux 4.11 introduces a new type, refcount_t, which conflicts with the
type of the same name defined within ZFS.

Rename the ZFS type zfs_refcount_t.  Within the ZFS code, use a macro to
cause references to refcount_t to be changed to zfs_refcount_t at
compile time.  This reduces conflicts when later landing OpenZFS
patches.

Fixes openzfs#5823

Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
l1k pushed a commit to l1k/zfs that referenced this issue Apr 17, 2017
Linux 4.11 introduces a new type, refcount_t, which conflicts with the
type of the same name defined within ZFS.

Rename the ZFS type zfs_refcount_t.  Within the ZFS code, use a macro to
cause references to refcount_t to be changed to zfs_refcount_t at
compile time.  This reduces conflicts when later landing OpenZFS
patches.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes openzfs#5823
Closes openzfs#5842
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue May 18, 2017
Linux 4.11 introduces a new type, refcount_t, which conflicts with the
type of the same name defined within ZFS.

Rename the ZFS type zfs_refcount_t.  Within the ZFS code, use a macro to
cause references to refcount_t to be changed to zfs_refcount_t at
compile time.  This reduces conflicts when later landing OpenZFS
patches.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes openzfs#5823
Closes openzfs#5842
tonyhutter pushed a commit that referenced this issue Jun 9, 2017
Linux 4.11 introduces a new type, refcount_t, which conflicts with the
type of the same name defined within ZFS.

Rename the ZFS type zfs_refcount_t.  Within the ZFS code, use a macro to
cause references to refcount_t to be changed to zfs_refcount_t at
compile time.  This reduces conflicts when later landing OpenZFS
patches.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes #5823
Closes #5842
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant