Files
linux/include/linux
Konrad Rzeszutek Wilk f84adf4921 xen-blkfront: drop the use of llist_for_each_entry_safe
Replace llist_for_each_entry_safe with a while loop.

llist_for_each_entry_safe can trigger a bug in GCC 4.1, so it's best
to remove it and use a while loop and do the deletion manually.

Specifically this bug can be triggered by hot-unplugging a disk, either
by doing xm block-detach or by save/restore cycle.

BUG: unable to handle kernel paging request at fffffffffffffff0
IP: [<ffffffffa0047223>] blkif_free+0x63/0x130 [xen_blkfront]
The crash call trace is:
	...
bad_area_nosemaphore+0x13/0x20
do_page_fault+0x25e/0x4b0
page_fault+0x25/0x30
? blkif_free+0x63/0x130 [xen_blkfront]
blkfront_resume+0x46/0xa0 [xen_blkfront]
xenbus_dev_resume+0x6c/0x140
pm_op+0x192/0x1b0
device_resume+0x82/0x1e0
dpm_resume+0xc9/0x1a0
dpm_resume_end+0x15/0x30
do_suspend+0x117/0x1e0

When drilling down to the assembler code, on newer GCC it does
.L29:
        cmpq    $-16, %r12      #, persistent_gnt check
        je      .L30    	#, out of the loop
.L25:
	... code in the loop
        testq   %r13, %r13      # n
        je      .L29    	#, back to the top of the loop
        cmpq    $-16, %r12      #, persistent_gnt check
        movq    16(%r12), %r13  # <variable>.node.next, n
        jne     .L25    	#,	back to the top of the loop
.L30:

While on GCC 4.1, it is:
L78:
	... code in the loop
	testq   %r13, %r13      # n
        je      .L78    #,	back to the top of the loop
        movq    16(%rbx), %r13  # <variable>.node.next, n
        jmp     .L78    #,	back to the top of the loop

Which basically means that the exit loop condition instead of
being:

	&(pos)->member != NULL;

is:
	;

which makes the loop unbound.

Since xen-blkfront is the only user of the llist_for_each_entry_safe
macro remove it from llist.h.

Orabug: 16263164
CC: stable@vger.kernel.org
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2013-02-19 15:17:08 -05:00
..
2013-01-02 17:36:10 -08:00
2013-01-27 01:35:32 +01:00
2013-01-02 17:36:10 -08:00
2012-12-07 17:02:47 +00:00
2012-11-30 12:37:36 +01:00
2011-07-22 08:25:37 -07:00
2012-07-30 17:25:21 -07:00
2011-07-20 20:47:43 -04:00
2012-10-08 13:50:20 +10:30
2012-12-02 00:05:12 +00:00
2011-10-26 15:43:25 -04:00
2012-09-19 19:08:46 -06:00
2012-09-20 14:31:45 +02:00
2011-08-03 11:30:42 -04:00
2011-07-26 16:49:47 -07:00
2012-07-30 17:25:11 -07:00
2012-01-03 22:54:57 -05:00
2011-10-29 21:20:22 +02:00
2012-03-23 16:58:38 -07:00
2011-07-25 20:57:16 -07:00
2012-12-20 13:57:36 -05:00
2012-12-21 20:23:41 +00:00
2012-02-20 19:46:36 +11:00
2011-05-29 13:03:09 +01:00
2012-11-08 16:58:31 +01:00
2012-09-30 18:02:20 -07:00
2012-11-28 11:54:40 +01:00
2011-11-26 14:59:39 -05:00
2012-10-16 18:49:15 -07:00
2011-09-14 15:24:51 -04:00
2012-11-22 13:43:27 +09:00
2012-11-28 21:49:02 -05:00
2012-11-28 21:49:02 -05:00
2012-11-08 16:58:30 +01:00
2012-04-27 10:46:45 +08:00
2012-11-21 10:07:48 +01:00
2011-07-01 15:34:45 -07:00
2012-10-29 21:31:32 +01:00
2012-03-26 21:47:19 +02:00
2012-03-26 21:47:19 +02:00
2012-03-26 21:47:19 +02:00
2012-11-23 12:23:40 +01:00
2011-07-01 10:37:15 +02:00
2012-12-14 13:05:26 +10:30
2011-07-21 13:47:54 -07:00
2013-01-10 10:57:01 -08:00
2012-09-07 14:57:45 -04:00
2012-03-20 12:47:48 +01:00
2012-09-11 10:15:02 +02:00
2012-03-20 12:47:47 +01:00
2012-11-21 15:09:26 -08:00
2012-07-17 09:13:37 -07:00
2012-05-31 17:49:32 -07:00
2012-09-26 13:52:36 -07:00
2012-11-20 16:15:02 +10:00
2012-11-03 14:50:15 -04:00
2011-09-16 19:20:20 -04:00
2012-10-10 01:15:44 -04:00
2012-03-15 21:41:34 +01:00
2012-12-12 17:38:33 -08:00
2012-12-14 13:06:40 +10:30
2011-07-26 16:49:47 -07:00
2012-12-25 18:45:06 -05:00
2012-12-11 17:22:27 -08:00
2012-10-17 15:53:02 -05:00
2012-10-10 22:41:05 -04:00
2012-07-10 10:32:06 -05:00
2012-05-21 14:31:48 +01:00
2012-07-31 18:42:43 -07:00
2012-06-20 14:39:36 -07:00
2012-01-06 12:10:26 -08:00
2011-11-02 16:07:02 -07:00
2013-01-03 15:57:14 -08:00
2012-03-20 21:29:38 -04:00
2012-01-03 22:55:07 -05:00
2012-11-16 14:33:04 -08:00
2012-10-06 03:05:01 +09:00
2012-09-27 12:45:28 +02:00
2012-12-18 15:02:13 -08:00
2012-12-18 15:02:14 -08:00
2012-06-05 17:32:30 +02:00
2012-06-13 21:16:42 +02:00
2012-10-27 15:38:29 -07:00
2011-08-16 00:16:49 -07:00
2012-10-09 16:22:55 +09:00
2012-08-21 16:28:31 +02:00
2012-10-09 16:22:32 +09:00
2012-07-22 23:57:55 +04:00
2012-10-22 16:58:28 -07:00
2012-11-15 17:20:58 -08:00
2012-09-05 17:21:36 -07:00
2013-01-25 15:06:01 -08:00