kernel-ark/include
Herbert Xu b24d18aa74 [PATCH] list: add missing rcu_dereference on first element
It seems that all the list_*_rcu primitives are missing a memory barrier
on the very first dereference.  For example,

#define list_for_each_rcu(pos, head) \
	for (pos = (head)->next; prefetch(pos->next), pos != (head); \
		pos = rcu_dereference(pos->next))

It will go something like:

	pos = (head)->next

	prefetch(pos->next)

	pos != (head)

	do stuff

We're missing a barrier here.

	pos = rcu_dereference(pos->next)

		fetch pos->next

		barrier given by rcu_dereference(pos->next)

		store pos

Without the missing barrier, the pos->next value may turn out to be stale.
In fact, if "do stuff" were also dereferencing pos and relying on
list_for_each_rcu to provide the barrier then it may also break.

So here is a patch to make sure that we have a barrier for the first
element in the list.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: "Paul E. McKenney" <paulmck@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-10-17 08:59:10 -07:00
..
acpi [ACPI] ACPICA 20050902 2005-09-03 00:15:11 -04:00
asm-alpha [PATCH] slab: alpha inlining fix 2005-09-22 22:17:34 -07:00
asm-arm [ARM] 3011/1: pxafb: Add ability to set device parent + fix spitz compile error 2005-10-14 16:07:25 +01:00
asm-arm26 [PATCH] Remove unused var from asm/futex.h 2005-09-21 16:16:29 -07:00
asm-cris [PATCH] Remove unused var from asm/futex.h 2005-09-21 16:16:29 -07:00
asm-frv [PATCH] Remove unused var from asm/futex.h 2005-09-21 16:16:29 -07:00
asm-generic [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
asm-h8300 [PATCH] Remove unused var from asm/futex.h 2005-09-21 16:16:29 -07:00
asm-i386 [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
asm-ia64 [PATCH] ia64 basic __user annotations 2005-09-29 08:46:27 -07:00
asm-m32r [PATCH] m32r: more basic __user annotations 2005-09-26 18:29:50 -07:00
asm-m68k [PATCH] Remove unused var from asm/futex.h 2005-09-21 16:16:29 -07:00
asm-m68knommu [PATCH] Remove unused var from asm/futex.h 2005-09-21 16:16:29 -07:00
asm-mips [PATCH] mm: move_pte to remap ZERO_PAGE 2005-09-28 07:46:40 -07:00
asm-parisc [PATCH] Remove unused var from asm/futex.h 2005-09-21 16:16:29 -07:00
asm-powerpc [PATCH] ppc32: Fix timekeeping 2005-10-12 08:24:47 -07:00
asm-ppc [PATCH] ppc32: Tell userland about lack of standard TB 2005-10-12 08:24:47 -07:00
asm-ppc64 [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
asm-s390 [PATCH] s390 signal annotations 2005-09-29 08:46:27 -07:00
asm-sh [PATCH] Remove unused var from asm/futex.h 2005-09-21 16:16:29 -07:00
asm-sh64 [PATCH] Remove unused var from asm/futex.h 2005-09-21 16:16:29 -07:00
asm-sparc [PATCH] fix the breakage in sparc headers 2005-10-05 07:33:42 -07:00
asm-sparc64 [SPARC64]: Eliminate PCI IOMMU dma mapping size limit. 2005-10-13 22:15:24 -07:00
asm-um [PATCH] uml: Fix sysrq-r support for skas mode 2005-10-04 13:22:01 -07:00
asm-v850 [PATCH] Remove unused var from asm/futex.h 2005-09-21 16:16:29 -07:00
asm-x86_64 [PATCH] x86_64: Allocate cpu local data for all possible CPUs 2005-10-10 16:33:25 -07:00
asm-xtensa [PATCH] xtensa: remove io_remap_page_range and minor clean-ups 2005-09-22 22:17:37 -07:00
linux [PATCH] list: add missing rcu_dereference on first element 2005-10-17 08:59:10 -07:00
math-emu
media [PATCH] v4l: tveeprom improved to support newer Hauppage cards 2005-09-09 13:57:54 -07:00
mtd
net [TWSK]: Grab the module refcount for timewait sockets 2005-10-10 21:25:23 -07:00
pcmcia [PATCH] yenta: auto-tune EnE bridges for CardBus cards 2005-09-26 13:09:20 +02:00
rdma [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
rxrpc [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
scsi [SCSI] allow REPORT LUN scanning even for LUN 0 PQ of 3 2005-09-25 12:01:48 -05:00
sound [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
video [PATCH] drivers/video: Replace custom macro with isdigit() 2005-09-13 08:22:33 -07:00