<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/md/persistent-data, branch v3.4.105</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v3.4.105</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v3.4.105'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2014-06-07T23:02:05+00:00</updated>
<entry>
<title>dm thin: fix discard corruption</title>
<updated>2014-06-07T23:02:05+00:00</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2013-03-20T17:21:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=87dba703d0d9eb4352506dbd8f8878e3e2ee92f0'/>
<id>urn:sha1:87dba703d0d9eb4352506dbd8f8878e3e2ee92f0</id>
<content type='text'>
commit f046f89a99ccfd9408b94c653374ff3065c7edb3 upstream.

Fix a bug in dm_btree_remove that could leave leaf values with incorrect
reference counts.  The effect of this was that removal of a shared block
could result in the space maps thinking the block was no longer used.
More concretely, if you have a thin device and a snapshot of it, sending
a discard to a shared region of the thin could corrupt the snapshot.

Thinp uses a 2-level nested btree to store it's mappings.  This first
level is indexed by thin device, and the second level by logical
block.

Often when we're removing an entry in this mapping tree we need to
rebalance nodes, which can involve shadowing them, possibly creating a
copy if the block is shared.  If we do create a copy then children of
that node need to have their reference counts incremented.  In this
way reference counts percolate down the tree as shared trees diverge.

The rebalance functions were incrementing the children at the
appropriate time, but they were always assuming the children were
internal nodes.  This meant the leaf values (in our case packed
block/flags entries) were not being incremented.

Signed-off-by: Joe Thornber &lt;ejt@redhat.com&gt;
Signed-off-by: Alasdair G Kergon &lt;agk@redhat.com&gt;
[bwh: Backported to 3.2: bump target version numbers from 1.0.1 to 1.0.2]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
[xr: Backported to 3.4: bump target version numbers to 1.1.1]
Signed-off-by: Rui Xiang &lt;rui.xiang@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>dm space map common: make sure new space is used during extend</title>
<updated>2014-02-13T19:51:14+00:00</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2014-01-07T15:47:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=11690e1491de3c35b09bff55336c14aacbdf1627'/>
<id>urn:sha1:11690e1491de3c35b09bff55336c14aacbdf1627</id>
<content type='text'>
commit 12c91a5c2d2a8e8cc40a9552313e1e7b0a2d9ee3 upstream.

When extending a low level space map we should update nr_blocks at
the start so the new space is used for the index entries.

Otherwise extend can fail, e.g.: sm_metadata_extend call sequence
that fails:
 -&gt; sm_ll_extend
    -&gt; dm_tm_new_block -&gt; dm_sm_new_block -&gt; sm_bootstrap_new_block
    =&gt; returns -ENOSPC because smm-&gt;begin == smm-&gt;ll.nr_blocks

Signed-off-by: Joe Thornber &lt;ejt@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dm persistent data: rename node to btree_node</title>
<updated>2013-01-17T16:50:51+00:00</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2012-12-21T20:23:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=38d67580f65e46ec13c65c8ebb0666134f167658'/>
<id>urn:sha1:38d67580f65e46ec13c65c8ebb0666134f167658</id>
<content type='text'>
commit 550929faf89e2e2cdb3e9945ea87d383989274cf upstream.

This patch fixes a compilation failure on sparc32 by renaming struct node.

struct node is already defined in include/linux/node.h. On sparc32, it
happens to be included through other dependencies and persistent-data
doesn't compile because of conflicting declarations.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Alasdair G Kergon &lt;agk@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dm persistent data: fix allocation failure in space map checker init</title>
<updated>2012-07-16T16:04:26+00:00</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2012-07-03T11:55:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6d442d8f7e1a6920aad3d3f3ea544f6f8e6898b8'/>
<id>urn:sha1:6d442d8f7e1a6920aad3d3f3ea544f6f8e6898b8</id>
<content type='text'>
commit b0239faaf87c38bb419c9264bf20817438ddc3a9 upstream.

If CONFIG_DM_DEBUG_SPACE_MAPS is enabled and memory is fragmented and a
sufficiently-large metadata device is used in a thin pool then the space
map checker will fail to allocate the memory it requires.

Switch from kmalloc to vmalloc to allow larger virtually contiguous
allocations for the space map checker's internal count arrays.

Reported-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Alasdair G Kergon &lt;agk@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dm persistent data: handle space map checker creation failure</title>
<updated>2012-07-16T16:04:26+00:00</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2012-07-03T11:55:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7723bfa90d8a1f75f41ade1a13b9b32c9255b15c'/>
<id>urn:sha1:7723bfa90d8a1f75f41ade1a13b9b32c9255b15c</id>
<content type='text'>
commit 62662303e7f590fdfbb0070ab820a0ad4267c119 upstream.

If CONFIG_DM_DEBUG_SPACE_MAPS is enabled and dm_sm_checker_create()
fails, dm_tm_create_internal() would still return success even though it
cleaned up all resources it was supposed to have created.  This will
lead to a kernel crash:

general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC
...
RIP: 0010:[&lt;ffffffff81593659&gt;]  [&lt;ffffffff81593659&gt;] dm_bufio_get_block_size+0x9/0x20
Call Trace:
  [&lt;ffffffff81599bae&gt;] dm_bm_block_size+0xe/0x10
  [&lt;ffffffff8159b8b8&gt;] sm_ll_init+0x78/0xd0
  [&lt;ffffffff8159c1a6&gt;] sm_ll_new_disk+0x16/0xa0
  [&lt;ffffffff8159c98e&gt;] dm_sm_disk_create+0xfe/0x160
  [&lt;ffffffff815abf6e&gt;] dm_pool_metadata_open+0x16e/0x6a0
  [&lt;ffffffff815aa010&gt;] pool_ctr+0x3f0/0x900
  [&lt;ffffffff8158d565&gt;] dm_table_add_target+0x195/0x450
  [&lt;ffffffff815904c4&gt;] table_load+0xe4/0x330
  [&lt;ffffffff815917ea&gt;] ctl_ioctl+0x15a/0x2c0
  [&lt;ffffffff81591963&gt;] dm_ctl_ioctl+0x13/0x20
  [&lt;ffffffff8116a4f8&gt;] do_vfs_ioctl+0x98/0x560
  [&lt;ffffffff8116aa51&gt;] sys_ioctl+0x91/0xa0
  [&lt;ffffffff81869f52&gt;] system_call_fastpath+0x16/0x1b

Fix the space map checker code to return an appropriate ERR_PTR and have
dm_sm_disk_create() and dm_tm_create_internal() check for it with
IS_ERR.

Reported-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Alasdair G Kergon &lt;agk@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dm persistent data: fix shadow_info_leak on dm_tm_destroy</title>
<updated>2012-07-16T16:04:26+00:00</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2012-07-03T11:55:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=672c65731d62930439b91ff8a160830085d42a51'/>
<id>urn:sha1:672c65731d62930439b91ff8a160830085d42a51</id>
<content type='text'>
commit 25d7cd6faa7ae6ed2565617c3ee2500ccb8a9f7f upstream.

Cleanup the shadow table before destroying the transaction manager.

Reference: leak was identified with kmemleak when running
test_discard_random_sectors in the thinp-test-suite.

Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Alasdair G Kergon &lt;agk@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dm persistent data: remove space map ref_count entries if redundant</title>
<updated>2012-03-28T17:41:27+00:00</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2012-03-28T17:41:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=71fd5ae25d88841c08d5bbea90c0f0a12ca05509'/>
<id>urn:sha1:71fd5ae25d88841c08d5bbea90c0f0a12ca05509</id>
<content type='text'>
Save space by removing entries from the space map ref_count tree if
they're no longer needed.

Ref counts are stored in two places: a bitmap if the ref_count is
below 3, or a btree of uint32_t if 3 or above.

When a ref_count that was above 3 drops below we can remove it from
the tree and save some metadata space.  This removal was commented out
before because I was unsure why this was causing under-populated btree
nodes.  Earlier patches have fixed this issue.

Signed-off-by: Joe Thornber &lt;ejt@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Alasdair G Kergon &lt;agk@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm persistent data: remove redundant value_size arg from value_ptr</title>
<updated>2012-03-28T17:41:25+00:00</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2012-03-28T17:41:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a3aefb395e4f321c8b1314c88f1123624adcf743'/>
<id>urn:sha1:a3aefb395e4f321c8b1314c88f1123624adcf743</id>
<content type='text'>
Now that the value_size is held within every node of the btrees we can
remove this argument from value_ptr().

For the last few months a BUG_ON has been checking this argument is
the same as that held in the node.  No issues were reported.  So this
is a safe change.

Signed-off-by: Joe Thornber &lt;ejt@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Alasdair G Kergon &lt;agk@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm persistent data: fix btree rebalancing after remove</title>
<updated>2012-03-28T17:41:23+00:00</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2012-03-28T17:41:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b0988900bae9ecf968a8a8d086a9eec671a9517a'/>
<id>urn:sha1:b0988900bae9ecf968a8a8d086a9eec671a9517a</id>
<content type='text'>
When we remove an entry from a node we sometimes rebalance with it's
two neighbours.  This wasn't being done correctly; in some cases
entries have to move all the way from the right neighbour to the left
neighbour, or vice versa.  This patch pretty much re-writes the
balancing code to fix it.

This code is barely used currently; only when you delete a thin
device, and then only if you have hundreds of them in the same pool.
Once we have discard support, which removes mappings, this will be used
much more heavily.

Signed-off-by: Joe Thornber &lt;ejt@redhat.com&gt;
Cc: stable@kernel.org
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Alasdair G Kergon &lt;agk@redhat.com&gt;
</content>
</entry>
<entry>
<title>device-mapper: using EXPORT_SYBOL in dm-space-map-checker.c needs export.h</title>
<updated>2011-11-07T18:29:10+00:00</updated>
<author>
<name>Stephen Rothwell</name>
<email>sfr@canb.auug.org.au</email>
</author>
<published>2011-11-01T09:27:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a84450604d0fe08b6a2335efbedede18d3d7cc75'/>
<id>urn:sha1:a84450604d0fe08b6a2335efbedede18d3d7cc75</id>
<content type='text'>
Reported-by: Witold Baryluk &lt;baryluk@smp.if.uj.edu.pl&gt;
Signed-off-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
