Re: [linux-next:master 7115/7300] ld.lld: error: undefined symbol: __bad_xchg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 13, 2023, at 11:05, kernel test robot wrote:

> commit: 4a0d72ea10ce156eb2 [7115/7300] afs:  Overhaul invalidation handling to better support RO volumes
> config: arm-randconfig-003-20231213 
> (https://download.01.org/0day-ci/archive/20231213/202312131823.hO2NP34f-lkp@xxxxxxxxx/config)
> All errors (new ones prefixed by >>):
>
>>> ld.lld: error: undefined symbol: __bad_xchg
>    >>> referenced by callback.c
>    >>>               fs/afs/callback.o:(__afs_break_callback) in 
> archive vmlinux.a
>    >>> referenced by rotate.c
>    >>>               fs/afs/rotate.o:(afs_select_fileserver) in archive 
> vmlinux.a

I saw the same thing, and this seems to be broken on all 32-bit
architectures:

@@ -79,9 +79,9 @@ void __afs_break_callback(struct afs_vnode *vnode, enum afs_cb_break_reason reas
        _enter("");
 
        clear_bit(AFS_VNODE_NEW_CONTENT, &vnode->flags);
-       if (test_and_clear_bit(AFS_VNODE_CB_PROMISED, &vnode->flags)) {
+       if (xchg(&vnode->cb_expires_at, AFS_NO_CB_PROMISE) != AFS_NO_CB_PROMISE) {
                vnode->cb_break++;

I tried to replace this with xchg64(), but that only exists on
one architectures (unlike cmpxchg64(), which is on most but not
all 32-bit ones).

If this has to be an atomic operation, the only portable way I see
is to change cb_expires_at into an atomic64_t and modify
all references to use atomic operations.

     Arnd




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux