Skip to content

Commit

Permalink
Delete rw_semaphore.wait_lock configure check
Browse files Browse the repository at this point in the history
Last use of wait_lock was removed in "Linux 5.3 compat: retire
rw_tryupgrade()" (e7a99da).

Fixes the issue reported in
#11097 (comment)

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Orivej Desh <[email protected]>
Closes #11309
  • Loading branch information
orivej authored Dec 10, 2020
1 parent 1e4732c commit ab4fb9b
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions config/kernel-rwsem.m4
Original file line number Diff line number Diff line change
@@ -1,29 +1,3 @@
dnl #
dnl # 3.1 API Change
dnl #
dnl # The rw_semaphore.wait_lock member was changed from spinlock_t to
dnl # raw_spinlock_t at commit ddb6c9b58a19edcfac93ac670b066c836ff729f1.
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_RWSEM_SPINLOCK_IS_RAW], [
ZFS_LINUX_TEST_SRC([rwsem_spinlock_is_raw], [
#include <linux/rwsem.h>
],[
struct rw_semaphore dummy_semaphore __attribute__ ((unused));
raw_spinlock_t dummy_lock __attribute__ ((unused)) =
__RAW_SPIN_LOCK_INITIALIZER(dummy_lock);
dummy_semaphore.wait_lock = dummy_lock;
])
])

AC_DEFUN([ZFS_AC_KERNEL_RWSEM_SPINLOCK_IS_RAW], [
AC_MSG_CHECKING([whether struct rw_semaphore member wait_lock is raw])
ZFS_LINUX_TEST_RESULT([rwsem_spinlock_is_raw], [
AC_MSG_RESULT(yes)
],[
ZFS_LINUX_TEST_ERROR([rwsem_spinlock_is_raw])
])
])

dnl #
dnl # 3.16 API Change
dnl #
Expand Down Expand Up @@ -76,13 +50,11 @@ AC_DEFUN([ZFS_AC_KERNEL_RWSEM_ATOMIC_LONG_COUNT], [
])

AC_DEFUN([ZFS_AC_KERNEL_SRC_RWSEM], [
ZFS_AC_KERNEL_SRC_RWSEM_SPINLOCK_IS_RAW
ZFS_AC_KERNEL_SRC_RWSEM_ACTIVITY
ZFS_AC_KERNEL_SRC_RWSEM_ATOMIC_LONG_COUNT
])

AC_DEFUN([ZFS_AC_KERNEL_RWSEM], [
ZFS_AC_KERNEL_RWSEM_SPINLOCK_IS_RAW
ZFS_AC_KERNEL_RWSEM_ACTIVITY
ZFS_AC_KERNEL_RWSEM_ATOMIC_LONG_COUNT
])

2 comments on commit ab4fb9b

@em-winterschon
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, I've validated that removal of those code blocks allows ZFS 2.0.0-1 to be used with RHEL 8.4's Real Time Kernel, version 4.18.0-305.rt7.72.el8.x86_64. Haven't tried with 2.0.{1,2,3,4} quite yet.

Error Message

checking whether struct rw_semaphore member wait_lock is raw... configure: error:                                                                                                                                                                                              
        *** None of the expected "rwsem_spinlock_is_raw" interfaces were detected.                                                                                                                                                                                             
        *** This may be because your kernel version is newer than what is                                                                                                                                                                                                      
        *** supported, or you are using a patched custom kernel with                                                                                                                                                                                                           
        *** incompatible modifications.                                                                                                                                                                                                                                        
        ***                                                                                                                                                                                                                                                                    
        *** ZFS Version: zfs-2.0.0-1                                                                                                                                                                                                                                           
        *** Compatible Kernels: 3.10 - 5.9                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
Building module:                                                                                                                                                                                                                                                               
cleaning build area...(bad exit status: 2)                                                                                                                                                                                                                                     
make -j32 KERNELRELEASE=4.18.0-305.rt7.72.el8.x86_64...(bad exit status: 2)

After grepping through the source and finding config/kernel-rwsem.m4, I commented out the same lines shown in this commit. Afterwards, returned to base dir and ran ./autogen.sh, initiated the build via DKMS from RPMs that I had compiled back when 2.0.0.-1 was current, and it completed without errors. Pools are imported, things work, all is well.

Prior to moving forward I wanted to check if this fix was included in an existing bug report or code commit, so searched for openzfs rwsem_spinlock_is_raw and openzfs rhel realtime kernel, finding two old SPL related PRs: openzfs/spl#622 , openzfs/spl@588d900 and finally this current commit. The original issue that reports the problem w/ real time kernel is for Arch and kernel 5.x, so someone may find this information useful when running RHEL 8.4 in current release enterprise context instead of Arch's rolling non-enterprise release method, different use cases etc.

@behlendorf
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@em-winterschon thanks for letting us know. For reference, this was addressed as of the 2.0.1 tag.

Please sign in to comment.