<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/md/dm-thin.c, branch v3.4.34</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v3.4.34</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v3.4.34'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2012-08-09T15:31:40+00:00</updated>
<entry>
<title>dm thin: fix memory leak in process_prepared_mapping error paths</title>
<updated>2012-08-09T15:31:40+00:00</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2012-07-27T14:08:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e73b09d8f258df200adb6383c77c38c31f6f4baa'/>
<id>urn:sha1:e73b09d8f258df200adb6383c77c38c31f6f4baa</id>
<content type='text'>
commit 905386f82d08f66726912f303f3e6605248c60a3 upstream.

Fix memory leak in process_prepared_mapping by always freeing
the dm_thin_new_mapping structs from the mapping_pool mempool on
the error paths.

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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>dm thin: reduce endio_hook pool size</title>
<updated>2012-08-09T15:31:40+00:00</updated>
<author>
<name>Alasdair G Kergon</name>
<email>agk@redhat.com</email>
</author>
<published>2012-07-27T14:07:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b4ce163953a4baab2341ba42386904a7199d11af'/>
<id>urn:sha1:b4ce163953a4baab2341ba42386904a7199d11af</id>
<content type='text'>
commit 7768ed33ccdc02801c4483fc5682dc66ace14aea upstream.

Reduce the slab size used for the dm_thin_endio_hook mempool.

Allocation has been seen to fail on machines with smaller amounts
of memory due to fragmentation.

  lvm: page allocation failure. order:5, mode:0xd0
  device-mapper: table: 253:38: thin-pool: Error creating pool's endio_hook mempool

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 thin: do not send discards to shared blocks</title>
<updated>2012-07-29T15:04:20+00:00</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2012-07-20T13:25:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5b8bbc39d5678179f2fd4ee2e09005d8f277834c'/>
<id>urn:sha1:5b8bbc39d5678179f2fd4ee2e09005d8f277834c</id>
<content type='text'>
commit 650d2a06b4fe1cc1d218c20e256650f68bf0ca31 upstream.

When process_discard receives a partial discard that doesn't cover a
full block, it sends this discard down to that block. Unfortunately, the
block can be shared and the discard would corrupt the other snapshots
sharing this block.

This patch detects block sharing and ends the discard with success when
sending it to the shared block.

The above change means that if the device supports discard it can't be
guaranteed that a discard request zeroes data. Therefore, we set
ti-&gt;discard_zeroes_data_unsupported.

Thin target discard support with this bug arrived in commit
104655fd4dcebd50068ef30253a001da72e3a081 (dm thin: support discards).

Signed-off-by: Mikulas Patocka &lt;mpatocka@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 thin: fix table output when pool target disables discard passdown internally</title>
<updated>2012-05-19T00:01:01+00:00</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2012-05-19T00:01:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f402693d06f32e746c6153e459c5fb064fa02741'/>
<id>urn:sha1:f402693d06f32e746c6153e459c5fb064fa02741</id>
<content type='text'>
When the thin pool target clears the discard_passdown parameter
internally, it incorrectly changes the table line reported to userspace.
This breaks dumb string comparisons on these table lines in generic
userspace device-mapper library code and leads to tables being reloaded
repeatedly when nothing is actually meant to be changing.

This patch corrects this by no longer changing the table line when
discard passdown was disabled.

We can still tell when discard passdown is overridden by looking for the
message "Discard unsupported by data device (sdX): Disabling discard passdown."

This automatic detection is also moved from the 'load' to the 'resume'
so that it is re-evaluated should the properties of underlying devices
change.

Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Acked-by: Joe Thornber &lt;ejt@redhat.com&gt;
Signed-off-by: Alasdair G Kergon &lt;agk@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm thin: correct module description</title>
<updated>2012-05-12T00:43:19+00:00</updated>
<author>
<name>Alasdair G Kergon</name>
<email>agk@redhat.com</email>
</author>
<published>2012-05-12T00:43:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7cab8bf1601d38fd73a0a4ea40cc4892b26907cc'/>
<id>urn:sha1:7cab8bf1601d38fd73a0a4ea40cc4892b26907cc</id>
<content type='text'>
Remove duplicate copy of string "device-mapper" (DM_NAME) from
MODULE_DESCRIPTION.

Signed-off-by: Alasdair G Kergon &lt;agk@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm thin: fix unprotected use of prepared_discards list</title>
<updated>2012-05-12T00:43:16+00:00</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2012-05-12T00:43:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c3a0ce2eab76daf9516c817c3f227ea3f4549bd8'/>
<id>urn:sha1:c3a0ce2eab76daf9516c817c3f227ea3f4549bd8</id>
<content type='text'>
Fix two places in commit 104655fd4dce ("dm thin: support discards") that
didn't use pool-&gt;lock to protect against concurrent changes to the
prepared_discards list.

Without this fix, thin_endio() can race with process_discard(), leading
to concurrent list_add()s that result in the processes locking up with
an error like the following:

WARNING: at lib/list_debug.c:32 __list_add+0x8f/0xa0()
...
list_add corruption. next-&gt;prev should be prev (ffff880323b96140), but was ffff8801d2c48440. (next=ffff8801d2c485c0).
...
Pid: 17205, comm: kworker/u:1 Tainted: G        W  O 3.4.0-rc3.snitm+ #1
Call Trace:
 [&lt;ffffffff8103ca1f&gt;] warn_slowpath_common+0x7f/0xc0
 [&lt;ffffffff8103cb16&gt;] warn_slowpath_fmt+0x46/0x50
 [&lt;ffffffffa04f6ce6&gt;] ? bio_detain+0xc6/0x210 [dm_thin_pool]
 [&lt;ffffffff8124ff3f&gt;] __list_add+0x8f/0xa0
 [&lt;ffffffffa04f70d2&gt;] process_discard+0x2a2/0x2d0 [dm_thin_pool]
 [&lt;ffffffffa04f6a78&gt;] ? remap_and_issue+0x38/0x50 [dm_thin_pool]
 [&lt;ffffffffa04f7c3b&gt;] process_deferred_bios+0x7b/0x230 [dm_thin_pool]
 [&lt;ffffffffa04f7df0&gt;] ? process_deferred_bios+0x230/0x230 [dm_thin_pool]
 [&lt;ffffffffa04f7e42&gt;] do_worker+0x52/0x60 [dm_thin_pool]
 [&lt;ffffffff81056fa9&gt;] process_one_work+0x129/0x450
 [&lt;ffffffff81059b9c&gt;] worker_thread+0x17c/0x3c0
 [&lt;ffffffff81059a20&gt;] ? manage_workers+0x120/0x120
 [&lt;ffffffff8105eabe&gt;] kthread+0x9e/0xb0
 [&lt;ffffffff814ceda4&gt;] kernel_thread_helper+0x4/0x10
 [&lt;ffffffff8105ea20&gt;] ? kthread_freezable_should_stop+0x70/0x70
 [&lt;ffffffff814ceda0&gt;] ? gs_change+0x13/0x13
---[ end trace 7e0a523bc5e52692 ]---

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 thin: reinstate missing mempool_free in cell_release_singleton</title>
<updated>2012-05-12T00:43:12+00:00</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2012-05-12T00:43:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=03aaae7cdc71bc306888440b1f569d463e917b6d'/>
<id>urn:sha1:03aaae7cdc71bc306888440b1f569d463e917b6d</id>
<content type='text'>
Fix a significant memory leak inadvertently introduced during
simplification of cell_release_singleton() in commit
6f94a4c45a6f744383f9f695dde019998db3df55 ("dm thin: fix stacked bi_next
usage").

A cell's hlist_del() must be accompanied by a mempool_free().
Use __cell_release() to do this, like before.

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 thin: add pool target flags to control discard</title>
<updated>2012-03-28T17:41:29+00:00</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2012-03-28T17:41:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=67e2e2b281812b5caf4923a38aadc6b89e34f064'/>
<id>urn:sha1:67e2e2b281812b5caf4923a38aadc6b89e34f064</id>
<content type='text'>
Add dm thin target arguments to control discard support.

ignore_discard: Disables discard support

no_discard_passdown: Don't pass discards down to the underlying data
device, but just remove the mapping within the thin provisioning target.

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 thin: support discards</title>
<updated>2012-03-28T17:41:28+00:00</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2012-03-28T17:41:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=104655fd4dcebd50068ef30253a001da72e3a081'/>
<id>urn:sha1:104655fd4dcebd50068ef30253a001da72e3a081</id>
<content type='text'>
Support discards in the thin target.

On discard the corresponding mapping(s) are removed from the thin
device.  If the associated block(s) are no longer shared the discard
is passed to the underlying device.

All bios other than discards now have an associated deferred_entry
that is saved to the 'all_io_entry' in endio_hook.  When non-discard
IO completes and associated mappings are quiesced any discards that
were deferred, via ds_add_work() in process_discard(), will be queued
for processing by the worker thread.

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;

drivers/md/dm-thin.c |  173 ++++++++++++++++++++++++++++++++++++++++++++++----
 drivers/md/dm-thin.c |  172 ++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 158 insertions(+), 14 deletions(-)
</content>
</entry>
<entry>
<title>dm thin: prepare to support discard</title>
<updated>2012-03-28T17:41:28+00:00</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2012-03-28T17:41:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eb2aa48d4eb7aee63cba201bf47641dad3e92250'/>
<id>urn:sha1:eb2aa48d4eb7aee63cba201bf47641dad3e92250</id>
<content type='text'>
This patch contains the ground work needed for dm-thin to support discard.

  - Adds endio function that replaces shared_read_endio.

  - Introduce an explicit 'quiesced' flag into the new_mapping structure.
    Before, this was implicitly indicated by m-&gt;list being empty.

  - The map_info-&gt;ptr remains constant for the duration of a bio's trip
    through the thin target.  Make it easier to reason about it.

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>
</feed>
