[LV] [PATCH] Fix __copy_tofrom_user() copying zero bytes

Maciej W. Rozycki macro at linux-mips.org
Mon May 18 01:57:33 CEST 2009


 Fix the case of requesting zero bytes to be copied by 
__copy_tofrom_user().  Such invocations happen for example with certain 
patterns of accesses with scatter-gather I/O syscalls.

Signed-off-by: Maciej W. Rozycki <macro at linux-mips.org>
---
 Please apply.

  Maciej

patch-mips-2.6.25-20080422-vax-copy-user-zero-2
diff -up --recursive --new-file linux-mips-2.6.25-20080422.macro/arch/vax/lib/copy_tofrom_user.S linux-mips-2.6.25-20080422/arch/vax/lib/copy_tofrom_user.S
--- linux-mips-2.6.25-20080422.macro/arch/vax/lib/copy_tofrom_user.S	2008-05-01 00:00:00.000000000 +0000
+++ linux-mips-2.6.25-20080422/arch/vax/lib/copy_tofrom_user.S	2009-05-01 23:21:09.000000000 +0000
@@ -23,10 +23,12 @@
 	movl 4(%ap), %r2  /* to in r2 */
 	movl 8(%ap), %r3  /* from in r3 */
 	movl 12(%ap), %r0 /* size in r0 */
+	beqlu 2f
 
 1:	EX(movb, (%r3)+, %r4, l_fixup)
 	EX(movb, %r4, (%r2)+, s_fixup)
 	sobgtr %r0, 1b
+2:
 	ret
 	.section .fixup,"ax"
 	.align 4
_______________________________________________
Linux-Vax mailing list
Linux-Vax at mail.pergamentum.com
http://mail.pergamentum.com/mailman/listinfo/linux-vax




More information about the Vax-linux mailing list