* [PATCH] SUNRPC: use cmpxchg64() in gss_seq_send64_fetch_and_inc()
@ 2018-10-02 20:57 Arnd Bergmann
2018-10-05 13:36 ` Trond Myklebust
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2018-10-02 20:57 UTC (permalink / raw)
To: Trond Myklebust
Cc: Arnd Bergmann, Anna Schumaker, J. Bruce Fields, Jeff Layton,
David S. Miller, Stephen Hemminger, James Ettle, linux-nfs,
netdev, linux-kernel
The newly introduced gss_seq_send64_fetch_and_inc() fails to build on
32-bit architectures:
net/sunrpc/auth_gss/gss_krb5_seal.c:144:14: note: in expansion of macro 'cmpxchg'
seq_send = cmpxchg(&ctx->seq_send64, old, old + 1);
^~~~~~~
arch/x86/include/asm/cmpxchg.h:128:3: error: call to '__cmpxchg_wrong_size' declared with attribute error: Bad argument size for cmpxchg
__cmpxchg_wrong_size(); \
As the message tells us, cmpxchg() cannot be used on 64-bit arguments,
that's what cmpxchg64() does.
Fixes: 571ed1fd2390 ("SUNRPC: Replace krb5_seq_lock with a lockless scheme")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
net/sunrpc/auth_gss/gss_krb5_seal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sunrpc/auth_gss/gss_krb5_seal.c b/net/sunrpc/auth_gss/gss_krb5_seal.c
index 92594681d619..5775b9805bdc 100644
--- a/net/sunrpc/auth_gss/gss_krb5_seal.c
+++ b/net/sunrpc/auth_gss/gss_krb5_seal.c
@@ -141,7 +141,7 @@ gss_seq_send64_fetch_and_inc(struct krb5_ctx *ctx)
do {
old = seq_send;
- seq_send = cmpxchg(&ctx->seq_send64, old, old + 1);
+ seq_send = cmpxchg64(&ctx->seq_send64, old, old + 1);
} while (old != seq_send);
return seq_send;
}
--
2.18.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] SUNRPC: use cmpxchg64() in gss_seq_send64_fetch_and_inc()
2018-10-02 20:57 [PATCH] SUNRPC: use cmpxchg64() in gss_seq_send64_fetch_and_inc() Arnd Bergmann
@ 2018-10-05 13:36 ` Trond Myklebust
0 siblings, 0 replies; 2+ messages in thread
From: Trond Myklebust @ 2018-10-05 13:36 UTC (permalink / raw)
To: arnd
Cc: linux-kernel, jlayton, bfields, linux-nfs, james, anna.schumaker,
netdev, davem, stephen
On Tue, 2018-10-02 at 22:57 +0200, Arnd Bergmann wrote:
> The newly introduced gss_seq_send64_fetch_and_inc() fails to build on
> 32-bit architectures:
>
> net/sunrpc/auth_gss/gss_krb5_seal.c:144:14: note: in expansion of
> macro 'cmpxchg'
> seq_send = cmpxchg(&ctx->seq_send64, old, old + 1);
> ^~~~~~~
> arch/x86/include/asm/cmpxchg.h:128:3: error: call to
> '__cmpxchg_wrong_size' declared with attribute error: Bad argument
> size for cmpxchg
> __cmpxchg_wrong_size(); \
>
> As the message tells us, cmpxchg() cannot be used on 64-bit
> arguments,
> that's what cmpxchg64() does.
>
> Fixes: 571ed1fd2390 ("SUNRPC: Replace krb5_seq_lock with a lockless
> scheme")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> net/sunrpc/auth_gss/gss_krb5_seal.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/sunrpc/auth_gss/gss_krb5_seal.c
> b/net/sunrpc/auth_gss/gss_krb5_seal.c
> index 92594681d619..5775b9805bdc 100644
> --- a/net/sunrpc/auth_gss/gss_krb5_seal.c
> +++ b/net/sunrpc/auth_gss/gss_krb5_seal.c
> @@ -141,7 +141,7 @@ gss_seq_send64_fetch_and_inc(struct krb5_ctx
> *ctx)
>
> do {
> old = seq_send;
> - seq_send = cmpxchg(&ctx->seq_send64, old, old + 1);
> + seq_send = cmpxchg64(&ctx->seq_send64, old, old + 1);
> } while (old != seq_send);
> return seq_send;
> }
Thanks Arndt! Applied.
--
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-05 13:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-02 20:57 [PATCH] SUNRPC: use cmpxchg64() in gss_seq_send64_fetch_and_inc() Arnd Bergmann
2018-10-05 13:36 ` Trond Myklebust
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).