<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/lib, branch v2.6.33.8</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/lib?h=v2.6.33.8</id>
<link rel='self' href='https://git.amat.us/linux/atom/lib?h=v2.6.33.8'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2011-03-21T19:43:44Z</updated>
<entry>
<title>percpu: fix list_head init bug in __percpu_counter_init()</title>
<updated>2011-03-21T19:43:44Z</updated>
<author>
<name>Masanori ITOH</name>
<email>itoumsn@nttdata.co.jp</email>
</author>
<published>2010-10-26T21:21:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1f383de442a419719650d3ff4c0aa7542f301a92'/>
<id>urn:sha1:1f383de442a419719650d3ff4c0aa7542f301a92</id>
<content type='text'>
commit 8474b591faf3bb0a1e08a60d21d6baac498f15e4 upstream.

WARNING: at lib/list_debug.c:26 __list_add+0x3f/0x81()
Hardware name: Express5800/B120a [N8400-085]
list_add corruption. next-&gt;prev should be prev (ffffffff81a7ea00), but was dead000000200200. (next=ffff88080b872d58).
Modules linked in: aoe ipt_MASQUERADE iptable_nat nf_nat autofs4 sunrpc bridge 8021q garp stp llc ipv6 cpufreq_ondemand acpi_cpufreq freq_table dm_round_robin dm_multipath kvm_intel kvm uinput lpfc scsi_transport_fc igb ioatdma scsi_tgt i2c_i801 i2c_core dca iTCO_wdt iTCO_vendor_support pcspkr shpchp megaraid_sas [last unloaded: aoe]
Pid: 54, comm: events/3 Tainted: G        W  2.6.34-vanilla1 #1
Call Trace:
[&lt;ffffffff8104bd77&gt;] warn_slowpath_common+0x7c/0x94
[&lt;ffffffff8104bde6&gt;] warn_slowpath_fmt+0x41/0x43
[&lt;ffffffff8120fd2e&gt;] __list_add+0x3f/0x81
[&lt;ffffffff81212a12&gt;] __percpu_counter_init+0x59/0x6b
[&lt;ffffffff810d8499&gt;] bdi_init+0x118/0x17e
[&lt;ffffffff811f2c50&gt;] blk_alloc_queue_node+0x79/0x143
[&lt;ffffffff811f2d2b&gt;] blk_alloc_queue+0x11/0x13
[&lt;ffffffffa02a931d&gt;] aoeblk_gdalloc+0x8e/0x1c9 [aoe]
[&lt;ffffffffa02aa655&gt;] aoecmd_sleepwork+0x25/0xa8 [aoe]
[&lt;ffffffff8106186c&gt;] worker_thread+0x1a9/0x237
[&lt;ffffffffa02aa630&gt;] ? aoecmd_sleepwork+0x0/0xa8 [aoe]
[&lt;ffffffff81065827&gt;] ? autoremove_wake_function+0x0/0x39
[&lt;ffffffff810616c3&gt;] ? worker_thread+0x0/0x237
[&lt;ffffffff810653ad&gt;] kthread+0x7f/0x87
[&lt;ffffffff8100aa24&gt;] kernel_thread_helper+0x4/0x10
[&lt;ffffffff8106532e&gt;] ? kthread+0x0/0x87
[&lt;ffffffff8100aa20&gt;] ? kernel_thread_helper+0x0/0x10

It's because there is no initialization code for a list_head contained in
the struct backing_dev_info under CONFIG_HOTPLUG_CPU, and the bug comes up
when block device drivers calling blk_alloc_queue() are used.  In case of
me, I got them by using aoe.

Signed-off-by: Masanori Itoh &lt;itoumsn@nttdata.co.jp&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>flex_array: fix the panic when calling flex_array_alloc() without __GFP_ZERO</title>
<updated>2010-05-12T22:02:32Z</updated>
<author>
<name>Changli Gao</name>
<email>xiaosuo@gmail.com</email>
</author>
<published>2010-04-23T17:17:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8cae69607df46a03b65b533794f31a3259dced72'/>
<id>urn:sha1:8cae69607df46a03b65b533794f31a3259dced72</id>
<content type='text'>
commit e59464c735db19619cde2aa331609adb02005f5b upstream.

memset() is called with the wrong address and the kernel panics.

Signed-off-by: Changli Gao &lt;xiaosuo@gmail.com&gt;
Cc: Patrick McHardy &lt;kaber@trash.net&gt;
Acked-by: David Rientjes &lt;rientjes@google.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>idr: fix a critical misallocation bug, take#2</title>
<updated>2010-02-23T03:50:34Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-02-22T20:44:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d2e7276b6b5e4bc2148891a056d5862c5314342d'/>
<id>urn:sha1:d2e7276b6b5e4bc2148891a056d5862c5314342d</id>
<content type='text'>
This is retry of reverted 859ddf09743a8cc680af33f7259ccd0fd36bfe9d
("idr: fix a critical misallocation bug") which contained two bugs.

* pa[idp-&gt;layers] should be cleared even if it's not used by
  sub_alloc() because it's used by mark idr_mark_full().

* The original condition check also assigned pa[l] to p which the new
  code didn't do thus leaving p pointing at the wrong layer.

Both problems have been fixed and the idr code has received good amount
testing using userland testing setup where simple bitmap allocator is
run parallel to verify the result of idr allocation.

The bug this patch fixes is caused by sub_alloc() optimization path
bypassing out-of-room condition check and restarting allocation loop
with starting value higher than maximum allowed value.  For detailed
description, please read commit message of 859ddf09.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Based-on-patch-from: Eric Paris &lt;eparis@redhat.com&gt;
Reported-by: Eric Paris &lt;eparis@redhat.com&gt;
Tested-by: Stefan Lippers-Hollmann &lt;s.l-h@gmx.de&gt;
Tested-by: Serge Hallyn &lt;serue@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>idr: revert misallocation bug fix</title>
<updated>2010-02-05T00:03:41Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-02-04T08:57:37Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6f14a668f1a8b715a6e855f4e32705e54a6e86a1'/>
<id>urn:sha1:6f14a668f1a8b715a6e855f4e32705e54a6e86a1</id>
<content type='text'>
Commit 859ddf09743a8cc680af33f7259ccd0fd36bfe9d tried to fix
misallocation bug but broke full bit marking by not clearing
pa[idp-&gt;layers] and also is causing X failures due to lookup failure
in drm code.  The cause of the latter hasn't been found yet.  Revert
the fix for now.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>idr: fix a critical misallocation bug</title>
<updated>2010-02-03T02:11:21Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-02-02T21:43:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=859ddf09743a8cc680af33f7259ccd0fd36bfe9d'/>
<id>urn:sha1:859ddf09743a8cc680af33f7259ccd0fd36bfe9d</id>
<content type='text'>
Eric Paris located a bug in idr.  With IDR_BITS of 6, it grows to three
layers when id 4096 is first allocated.  When that happens, idr wraps
incorrectly and searches the idr array ignoring the high bits.  The
following test code from Eric demonstrates the bug nicely.

#include &lt;linux/idr.h&gt;
#include &lt;linux/kernel.h&gt;
#include &lt;linux/module.h&gt;

static DEFINE_IDR(test_idr);

int init_module(void)
{
	int ret, forty95, forty96;
	void *addr;

	/* add 2 entries both with 4095 as the start address */
again1:
	if (!idr_pre_get(&amp;test_idr, GFP_KERNEL))
		return -ENOMEM;
	ret = idr_get_new_above(&amp;test_idr, (void *)4095, 4095, &amp;forty95);
	if (ret) {
		if (ret == -EAGAIN)
			goto again1;
		return ret;
	}
	if (forty95 != 4095)
		printk(KERN_ERR "hmmm, forty95=%d\n", forty95);

again2:
	if (!idr_pre_get(&amp;test_idr, GFP_KERNEL))
		return -ENOMEM;
	ret = idr_get_new_above(&amp;test_idr, (void *)4096, 4095, &amp;forty96);
	if (ret) {
		if (ret == -EAGAIN)
			goto again2;
		return ret;
	}
	if (forty96 != 4096)
		printk(KERN_ERR "hmmm, forty96=%d\n", forty96);

	/* try to find the 2 entries, noticing that 4096 broke */
	addr = idr_find(&amp;test_idr, forty95);
	if ((int)addr != forty95)
		printk(KERN_ERR "hmmm, after find forty95=%d addr=%d\n", forty95, (int)addr);
	addr = idr_find(&amp;test_idr, forty96);
	if ((int)addr != forty96)
		printk(KERN_ERR "hmmm, after find forty96=%d addr=%d\n", forty96, (int)addr);
	/* really weird, the entry which should be at 4096 is actually at 0!! */
	addr = idr_find(&amp;test_idr, 0);
	if ((int)addr)
		printk(KERN_ERR "found an entry at id=0 for addr=%d\n", (int)addr);

	idr_remove(&amp;test_idr, forty95);
	idr_remove(&amp;test_idr, forty96);

	return 0;
}

void cleanup_module(void)
{
}

MODULE_AUTHOR("Eric Paris &lt;eparis@redhat.com&gt;");
MODULE_DESCRIPTION("Simple idr test");
MODULE_LICENSE("GPL");

This happens because when sub_alloc() back tracks it doesn't always do it
step-by-step while the over-the-limit detection assumes step-by-step
backtracking.  The logic in sub_alloc() looks like the following.

  restart:
    clear pa[top level + 1] for end cond detection
    l = top level
    while (true) {
	search for empty slot at this level
	if (not found) {
	    push id to the next possible value
	    l++
A:	    if (pa[l] is clear)
	        failed, return asking caller to grow the tree
	    if (going up 1 level gives more slots to search)
	        continue the while loop above with the incremented l
	    else
C:	        goto restart
	}
	adjust id accordingly to the found slot
	if (l == 0)
	    return found id;
	create lower level if not there yet
	record pa[l] and l--
    }

Test A is the fail exit condition but this assumes that failure is
propagated upwared one level at a time but the B optimization path breaks
the assumption and restarts the whole thing with a start value which is
above the possible limit with the current layers.  sub_alloc() assumes the
start id value is inside the limit when called and test A is the only exit
condition check, so it ends up searching for empty slot while ignoring
high set bit.

So, for 4095-&gt;4096 test, level0 search fails but pa[1] contains a valid
pointer.  However, going up 1 level wouldn't give any more empty slot so
it takes C and when the whole thing restarts nobody notices the high bit
set beyond the top level.

This patch fixes the bug by changing the fail exit condition check to full
id limit check.

Based-on-patch-from: Eric Paris &lt;eparis@redhat.com&gt;
Reported-by: Eric Paris &lt;eparis@redhat.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge branches 'amd-iommu/fixes' and 'dma-debug/fixes' into iommu/fixes</title>
<updated>2010-01-22T17:00:41Z</updated>
<author>
<name>Joerg Roedel</name>
<email>joerg.roedel@amd.com</email>
</author>
<published>2010-01-22T17:00:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a02b11937a6e1079fdf386833129cd86a3576196'/>
<id>urn:sha1:a02b11937a6e1079fdf386833129cd86a3576196</id>
<content type='text'>
</content>
</entry>
<entry>
<title>lib/dma-debug.c: mark file-local struct symbol static.</title>
<updated>2010-01-22T16:59:51Z</updated>
<author>
<name>Thiago Farina</name>
<email>tfransosi@gmail.com</email>
</author>
<published>2010-01-18T23:57:33Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=aeb583d08172e038552bdefe0a79a9aa9e2ecd7c'/>
<id>urn:sha1:aeb583d08172e038552bdefe0a79a9aa9e2ecd7c</id>
<content type='text'>
warning: symbol 'filter_fops' was not declared. Should it be static?

Signed-off-by: Thiago Farina &lt;tfransosi@gmail.com&gt;
Signed-off-by: Joerg Roedel &lt;joerg.roedel@amd.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip</title>
<updated>2010-01-16T20:27:25Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2010-01-16T20:27:25Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6ccc347b699681a0b21c2f7b1a1f85500a58c6b8'/>
<id>urn:sha1:6ccc347b699681a0b21c2f7b1a1f85500a58c6b8</id>
<content type='text'>
* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  tracing/filters: Add comment for match callbacks
  tracing/filters: Fix MATCH_FULL filter matching for PTR_STRING
  tracing/filters: Fix MATCH_MIDDLE_ONLY filter matching
  lib: Introduce strnstr()
  tracing/filters: Fix MATCH_END_ONLY filter matching
  tracing/filters: Fix MATCH_FRONT_ONLY filter matching
  ftrace: Fix MATCH_END_ONLY function filter
  tracing/x86: Derive arch from bits argument in recordmcount.pl
  ring-buffer: Add rb_list_head() wrapper around new reader page next field
  ring-buffer: Wrap a list.next reference with rb_list_head()
</content>
</entry>
<entry>
<title>lib: Introduce strnstr()</title>
<updated>2010-01-15T03:38:09Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2010-01-14T02:53:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d5f1fb53353edc38da326445267c1df0c9676df2'/>
<id>urn:sha1:d5f1fb53353edc38da326445267c1df0c9676df2</id>
<content type='text'>
It differs strstr() in that it limits the length to be searched
in the first string.

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
LKML-Reference: &lt;4B4E8743.6030805@cn.fujitsu.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>zlib: Fix build of powerpc boot wrapper</title>
<updated>2010-01-14T00:13:39Z</updated>
<author>
<name>Benjamin Herrenschmidt</name>
<email>benh@kernel.crashing.org</email>
</author>
<published>2010-01-13T05:19:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6846ee5ca68d81e6baccf0d56221d7a00c1be18b'/>
<id>urn:sha1:6846ee5ca68d81e6baccf0d56221d7a00c1be18b</id>
<content type='text'>
Commit ac4c2a3bbe5db5fc570b1d0ee1e474db7cb22585 broke the build
of all powerpc boot wrappers.

It attempts to add an include of autoconf.h but used the wrong
path for it. It also adds -D__KERNEL__ to our boot wrapper, both
things that we pretty much didn't do on purpose so far.

We want our boot wrapper to remain independent enough of the kernel
for various reasons, one of them being that you can "wrap" an existing
kernel at distro install time which allows to ship one kernel image
and a set of boot wrappers for different platforms, the wrappers
don't have to be built out of the same kernel build tree.

It's also incorrect to do what the patch does in our boot environment
since we may not have a proper alignment exception handler which means
we may not be able to fixup the few cases where an unaligned access will
need SW emulation (depends on the core variant, could be when crossing
page or segment boundaries for example).

This patch fixes it by putting the old code back in and using the
new "fancy" variant only when CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
is set, which happens not to be set on powerpc since we don't include
autoconf.h. It also reverts the changes to our boot wrapper Makefile.

This means that x86 should, afaik, keep the optimisations since its
boot wrapper does include autoconf.h and define __KERNEL__ (though I
doubt they make that much different outside of slow embedded processors).

Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
