From 2695051df5998663ec9efdd5a00d99eb1c28aa53 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 31 Jan 2017 14:04:10 -0800 Subject: [PATCH] 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. Signed-off-by: Brian Behlendorf Issue #5671 --- lib/libspl/asm-i386/atomic.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libspl/asm-i386/atomic.S b/lib/libspl/asm-i386/atomic.S index d3d425090e1c..3086d5543949 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