<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/lib/test_xarray.c, branch v4.20</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.20</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.20'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2018-12-13T19:07:33Z</updated>
<entry>
<title>XArray: Fix xa_alloc when id exceeds max</title>
<updated>2018-12-13T19:07:33Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-12-13T18:57:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=48483614de97c4f5219abeda630e62b2bebdce62'/>
<id>urn:sha1:48483614de97c4f5219abeda630e62b2bebdce62</id>
<content type='text'>
Specifying a starting ID greater than the maximum ID isn't something
attempted very often, but it should fail.  It was succeeding due to
xas_find_marked() returning the wrong error state, so add tests for
both xa_alloc() and xas_find_marked().

Fixes: b803b42823d0 ("xarray: Add XArray iterators")
Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray tests: Check iterating over multiorder entries</title>
<updated>2018-12-06T14:25:33Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-11-29T21:04:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4f145cd66a1a76136ff5a03a99e37ba082715dc6'/>
<id>urn:sha1:4f145cd66a1a76136ff5a03a99e37ba082715dc6</id>
<content type='text'>
There was no bug here, but there was no test coverage for this scenario.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray tests: Handle larger indices more elegantly</title>
<updated>2018-12-06T14:25:15Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-11-05T18:19:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b7677a132a4c2ff877986c5b30f9427127b9897a'/>
<id>urn:sha1:b7677a132a4c2ff877986c5b30f9427127b9897a</id>
<content type='text'>
xa_mk_value() only handles values up to LONG_MAX.  I successfully hid
that inside xa_store_index() and xa_erase_index(), but it turned out I
also needed it for testing xa_alloc() on 32-bit machines.  So extract
xa_mk_index() from the above two functions, and convert the non-constant
users of xa_mk_value() to xa_mk_index().

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray tests: Add missing locking</title>
<updated>2018-11-19T14:41:11Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-11-19T14:36:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fffc9a260e38acec3187515738122a3ecb24ac90'/>
<id>urn:sha1:fffc9a260e38acec3187515738122a3ecb24ac90</id>
<content type='text'>
Lockdep caught me being sloppy in the test suite and failing to lock
the XArray appropriately.

Reported-by: kernel test robot &lt;rong.a.chen@intel.com&gt;
Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray tests: Correct some 64-bit assumptions</title>
<updated>2018-11-16T21:38:45Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-11-05T14:34:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5404a7f1c21cfda061712bedf2d06cc0f6c755e9'/>
<id>urn:sha1:5404a7f1c21cfda061712bedf2d06cc0f6c755e9</id>
<content type='text'>
The test-suite caught these two mistakes when compiled for 32-bit.
I had only been running the test-suite in 64-bit mode.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Regularise xa_reserve</title>
<updated>2018-11-05T21:38:08Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-10-30T13:45:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4c0608f4a0e76dfb82d3accd20081f4bf47ed143'/>
<id>urn:sha1:4c0608f4a0e76dfb82d3accd20081f4bf47ed143</id>
<content type='text'>
The xa_reserve() function was a little unusual in that it attempted to
be callable for all kinds of locking scenarios.  Make it look like the
other APIs with __xa_reserve, xa_reserve_bh and xa_reserve_irq variants.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>XArray: Fix xa_for_each with a single element at 0</title>
<updated>2018-11-05T19:56:46Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-11-01T20:55:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8229706e03e4147f3e22d1de0d30630cde6d18a9'/>
<id>urn:sha1:8229706e03e4147f3e22d1de0d30630cde6d18a9</id>
<content type='text'>
The following sequence of calls would result in an infinite loop in
xa_find_after():

	xa_store(xa, 0, x, GFP_KERNEL);
	index = 0;
	xa_for_each(xa, entry, index, ULONG_MAX, XA_PRESENT) { }

xa_find_after() was confusing the situation where we found no entry in
the tree with finding a multiorder entry, so it would look for the
successor entry forever.  Just check for this case explicitly.  Includes
a few new checks in the test suite to be sure this doesn't reappear.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>xarray: Add range store functionality</title>
<updated>2018-10-21T14:46:46Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-08-15T18:13:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0e9446c35a80931044b6d8d2d74a9cabd248539f'/>
<id>urn:sha1:0e9446c35a80931044b6d8d2d74a9cabd248539f</id>
<content type='text'>
This version of xa_store_range() really only supports load and store.
Our only user only needs basic load and store functionality, so there's
no need to do the extra work to support marking and overlapping stores
correctly yet.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>xarray: Move multiorder_check to in-kernel tests</title>
<updated>2018-10-21T14:46:46Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-09-09T05:52:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4f06d6302da682157890f72c0573e12a73536814'/>
<id>urn:sha1:4f06d6302da682157890f72c0573e12a73536814</id>
<content type='text'>
This version is a little less thorough in order to be a little quicker,
but tests the important edge cases.  Also test adding a multiorder entry
at a non-canonical index, and erasing it.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
<entry>
<title>xarray: Move multiorder_shrink to kernel tests</title>
<updated>2018-10-21T14:46:46Z</updated>
<author>
<name>Matthew Wilcox</name>
<email>willy@infradead.org</email>
</author>
<published>2018-09-08T16:09:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=93eb07f72c8d86f8fe5e90907df1cc037f6ffbb7'/>
<id>urn:sha1:93eb07f72c8d86f8fe5e90907df1cc037f6ffbb7</id>
<content type='text'>
Test this functionality inside the kernel as well as in userspace.
Also remove insert_bug() as there's no comparable thing to test
in the XArray code.

Signed-off-by: Matthew Wilcox &lt;willy@infradead.org&gt;
</content>
</entry>
</feed>
