From: Brian Behlendorf Date: Wed, 1 Feb 2017 17:36:47 +0000 (-0800) Subject: Fix atomic_sub_64() i386 assembly implementation X-Git-Tag: zfs-0.7.0-rc4~190 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b6425cb5bfd0fc2a14eee451ba36873318a96d9;p=zfs Fix atomic_sub_64() i386 assembly implementation The atomic_sub_64() should use sbbl instead of adcl. In user space these atomics are used for statistics tracking and aren't critical which explain how this was overlooked. The kernel space implementation of these atomics are layered on the architecture specific implementations provided by the kernel. Reviewed by: Stefan Ring Reviewed-by: Gvozden Neskovic Signed-off-by: Brian Behlendorf Closes #5671 Closes #5717 --- diff --git a/lib/libspl/asm-i386/atomic.S b/lib/libspl/asm-i386/atomic.S index d3d425090..3086d5543 100644 --- a/lib/libspl/asm-i386/atomic.S +++ b/lib/libspl/asm-i386/atomic.S @@ -507,7 +507,7 @@ movl 16(%esp), %ebx movl 20(%esp), %ecx subl %eax, %ebx - adcl %edx, %ecx + sbbl %edx, %ecx lock cmpxchg8b (%edi) jne 1b