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

5.3.0 compat / rwlock #9023

Closed
c0d3z3r0 opened this issue Jul 12, 2019 · 5 comments
Closed

5.3.0 compat / rwlock #9023

c0d3z3r0 opened this issue Jul 12, 2019 · 5 comments
Labels
Type: Building Indicates an issue related to building binaries

Comments

@c0d3z3r0
Copy link
Contributor

System information

Type Version/Name
Distribution Name Debian
Distribution Version testing
Linux Kernel 5.2.0
Architecture amd64
ZFS Version master (d230a65)
SPL Version -

Describe the problem you're observing

ZFS builds fine in-tree with linux 5.2.0-rc7. 5.2.0 fails:

  CC      fs/zfs/icp/illumos-crypto.o
  CC      fs/zfs/lua/lapi.o
  CC      fs/zfs/nvpair/nvpair.o
  CC      fs/zfs/icp/api/kcf_cipher.o
In file included from ./include/zfs/spl/sys/taskq.h:35,
                 from ./include/zfs/spl/sys/kmem_cache.h:28,
                 from ./include/zfs/sys/zfs_context.h:41,
                 from ./include/zfs/sys/crypto/common.h:39,
                 from fs/zfs/icp/illumos-crypto.c:35:
./include/zfs/spl/sys/rwlock.h: In function ‘rw_owner’:
./include/zfs/spl/sys/rwlock.h:121:18: error: incompatible types when returning type ‘atomic_long_t’ {aka ‘struct <anonymous>’} but ‘kthread_t *’ {aka ‘struct task_struct *’} was expected
  return (SEM(rwp)->owner);
         ~~~~~~~~~^~~~~~~~
./include/zfs/spl/sys/rwlock.h: In function ‘RW_READ_HELD’:
./include/zfs/spl/sys/rwlock.h:199:26: warning: comparison between pointer and integer
  if (RWSEM_OWNER_UNKNOWN == (struct task_struct *)-2L) {
                          ^~
./include/zfs/spl/sys/rwlock.h:201:3: error: aggregate value used where an integer was expected
   return ((unsigned long) SEM(rwp)->owner & 1);
   ^~~~~~
In file included from ./include/zfs/spl/sys/taskq.h:35,
                 from ./include/zfs/spl/sys/kmem_cache.h:28,
                 from ./include/zfs/sys/zfs_context.h:41,
                 from ./include/zfs/sys/lua/lua.h:13,
                 from fs/zfs/lua/lapi.c:12:
./include/zfs/spl/sys/rwlock.h: In function ‘rw_owner’:
./include/zfs/spl/sys/rwlock.h:121:18: error: incompatible types when returning type ‘atomic_long_t’ {aka ‘struct <anonymous>’} but ‘kthread_t *’ {aka ‘struct task_struct *’} was expected
  return (SEM(rwp)->owner);
         ~~~~~~~~~^~~~~~~~
./include/zfs/spl/sys/rwlock.h: In function ‘RW_READ_HELD’:
./include/zfs/spl/sys/rwlock.h:199:26: warning: comparison between pointer and integer
  if (RWSEM_OWNER_UNKNOWN == (struct task_struct *)-2L) {
                          ^~
./include/zfs/spl/sys/rwlock.h:201:3: error: aggregate value used where an integer was expected
   return ((unsigned long) SEM(rwp)->owner & 1);
   ^~~~~~
make[3]: *** [scripts/Makefile.build:279: fs/zfs/icp/illumos-crypto.o] Error 1
make[3]: *** Waiting for unfinished jobs....
  CC      fs/file_table.o
make[3]: *** [scripts/Makefile.build:279: fs/zfs/lua/lapi.o] Error 1
make[2]: *** [scripts/Makefile.build:489: fs/zfs/lua] Error 2
make[2]: *** Waiting for unfinished jobs....
  CC      fs/super.o
  CC      fs/char_dev.o
In file included from ./include/zfs/spl/sys/taskq.h:35,
                 from ./include/zfs/spl/sys/kmem_cache.h:28,
                 from ./include/zfs/sys/zfs_context.h:41,
                 from fs/zfs/icp/api/kcf_cipher.c:26:
./include/zfs/spl/sys/rwlock.h: In function ‘rw_owner’:
./include/zfs/spl/sys/rwlock.h:121:18: error: incompatible types when returning type ‘atomic_long_t’ {aka ‘struct <anonymous>’} but ‘kthread_t *’ {aka ‘struct task_struct *’} was expected
  return (SEM(rwp)->owner);
         ~~~~~~~~~^~~~~~~~
./include/zfs/spl/sys/rwlock.h: In function ‘RW_READ_HELD’:
./include/zfs/spl/sys/rwlock.h:199:26: warning: comparison between pointer and integer
  if (RWSEM_OWNER_UNKNOWN == (struct task_struct *)-2L) {
                          ^~
./include/zfs/spl/sys/rwlock.h:201:3: error: aggregate value used where an integer was expected
   return ((unsigned long) SEM(rwp)->owner & 1);
   ^~~~~~
make[3]: *** [scripts/Makefile.build:279: fs/zfs/icp/api/kcf_cipher.o] Error 1
make[2]: *** [scripts/Makefile.build:489: fs/zfs/icp] Error 2
  CC      fs/stat.o
  CC      fs/exec.o
  CC      fs/pipe.o
  CC      fs/zfs/nvpair/fnvpair.o
  CC      fs/namei.o
  CC      fs/fcntl.o
  CC      fs/zfs/nvpair/nvpair_alloc_spl.o
  CC      fs/zfs/nvpair/nvpair_alloc_fixed.o
  CC      fs/ioctl.o
  CC      fs/readdir.o
  AR      fs/zfs/nvpair/built-in.a
make[1]: *** [scripts/Makefile.build:489: fs/zfs] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1071: fs] Error 2
make: *** Waiting for unfinished jobs....
@behlendorf behlendorf added the Type: Building Indicates an issue related to building binaries label Jul 12, 2019
@behlendorf
Copy link
Contributor

@c0d3z3r0 I'm relatively certain you must have been using a commit from after the 5.2 tag. This build failure was caused by https://lkml.org/lkml/2019/7/8/1415 which was just merged for 5.3. The fix looks pretty straight forward, I'll see about getting a PR open in the next couple of days.

@c0d3z3r0
Copy link
Contributor Author

Well, I am very sure that I used v5.2 tag, but I will check this again later

@kusumi
Copy link
Member

kusumi commented Jul 12, 2019

I compiled 5.2 (torvalds/linux@0ecfebd) a few days ago, and did not see this. There were compat issues only in -rc1 for 5.2 iirc.

@kusumi
Copy link
Member

kusumi commented Jul 12, 2019

the exact commit is torvalds/linux@94a9717 which appeared after torvalds/linux@0ecfebd.

 struct rw_semaphore {
        atomic_long_t count;
        /*
-        * Write owner or one of the read owners. Can be used as a
-        * speculative check to see if the owner is running on the cpu.
+        * Write owner or one of the read owners as well flags regarding
+        * the current state of the rwsem. Can be used as a speculative
+        * check to see if the write owner is running on the cpu.
         */
-       struct task_struct *owner;
+       atomic_long_t owner;

@c0d3z3r0
Copy link
Contributor Author

oh damn. seems I was simply to tired to get this right... thanks

@behlendorf behlendorf changed the title 5.2.0 compat / rwlock 5.3.0 compat / rwlock Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Building Indicates an issue related to building binaries
Projects
None yet
Development

No branches or pull requests

3 participants