<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/md/persistent-data, branch v3.12.10</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/md/persistent-data?h=v3.12.10</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/md/persistent-data?h=v3.12.10'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-12-20T15:49:05Z</updated>
<entry>
<title>dm thin: allow pool in read-only mode to transition to read-write mode</title>
<updated>2013-12-20T15:49:05Z</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2013-12-04T21:58:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3e9c394744efc5d872bce0762637e31d7f54cda6'/>
<id>urn:sha1:3e9c394744efc5d872bce0762637e31d7f54cda6</id>
<content type='text'>
commit 9b7aaa64f96f7ca280d75326fca42f42017b89ef upstream.

A thin-pool may be in read-only mode because the pool's data or metadata
space was exhausted.  To allow for recovery, by adding more space to the
pool, we must allow a pool to transition from PM_READ_ONLY to PM_WRITE
mode.  Otherwise, running out of space will render the pool permanently
read-only.

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 space map: disallow decrementing a reference count below zero</title>
<updated>2013-12-20T15:49:04Z</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2013-12-13T12:31:08Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cb4d254628bb8f74d9034eb701600555939c6143'/>
<id>urn:sha1:cb4d254628bb8f74d9034eb701600555939c6143</id>
<content type='text'>
commit 5b564d80f8bc21094c0cd2b19b679d983aabcc29 upstream.

The old behaviour, returning -EINVAL if a ref_count of 0 would be
decremented, was removed in commit f722063 ("dm space map: optimise
sm_ll_dec and sm_ll_inc").  To fix this regression we return an error
code from the mutator function pointer passed to sm_ll_mutate() and have
dec_ref_count() return -EINVAL if the old ref_count is 0.

Add a DMERR to reflect the potential seriousness of this error.

Also, add missing dm_tm_unlock() to sm_ll_mutate()'s error path.

With this fix the following dmts regression test now passes:
 dmtest run --suite cache -n /metadata_use_kernel/

The next patch fixes the higher-level dm-array code that exposed this
regression.

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 space map metadata: return on failure in sm_metadata_new_block</title>
<updated>2013-12-20T15:49:04Z</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2013-12-02T21:47:01Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bc09538e4813d30b98dc1aae91c6e2345626f2bd'/>
<id>urn:sha1:bc09538e4813d30b98dc1aae91c6e2345626f2bd</id>
<content type='text'>
commit f62b6b8f498658a9d537c7d380e9966f15e1b2a1 upstream.

Commit 2fc48021f4afdd109b9e52b6eef5db89ca80bac7 ("dm persistent
metadata: add space map threshold callback") introduced a regression
to the metadata block allocation path that resulted in errors being
ignored.  This regression was uncovered by running the following
device-mapper-test-suite test:
dmtest run --suite thin-provisioning -n /exhausting_metadata_space_causes_fail_mode/

The ignored error codes in sm_metadata_new_block() could crash the
kernel through use of either the dm-thin or dm-cache targets, e.g.:

device-mapper: thin: 253:4: reached low water mark for metadata device: sending event.
device-mapper: space map metadata: unable to allocate new metadata block
general protection fault: 0000 [#1] SMP
...
Workqueue: dm-thin do_worker [dm_thin_pool]
task: ffff880035ce2ab0 ti: ffff88021a054000 task.ti: ffff88021a054000
RIP: 0010:[&lt;ffffffffa0331385&gt;]  [&lt;ffffffffa0331385&gt;] metadata_ll_load_ie+0x15/0x30 [dm_persistent_data]
RSP: 0018:ffff88021a055a68  EFLAGS: 00010202
RAX: 003fc8243d212ba0 RBX: ffff88021a780070 RCX: ffff88021a055a78
RDX: ffff88021a055a78 RSI: 0040402222a92a80 RDI: ffff88021a780070
RBP: ffff88021a055a68 R08: ffff88021a055ba4 R09: 0000000000000010
R10: 0000000000000000 R11: 00000002a02e1000 R12: ffff88021a055ad4
R13: 0000000000000598 R14: ffffffffa0338470 R15: ffff88021a055ba4
FS:  0000000000000000(0000) GS:ffff88033fca0000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00007f467c0291b8 CR3: 0000000001a0b000 CR4: 00000000000007e0
Stack:
 ffff88021a055ab8 ffffffffa0332020 ffff88021a055b30 0000000000000001
 ffff88021a055b30 0000000000000000 ffff88021a055b18 0000000000000000
 ffff88021a055ba4 ffff88021a055b98 ffff88021a055ae8 ffffffffa033304c
Call Trace:
 [&lt;ffffffffa0332020&gt;] sm_ll_lookup_bitmap+0x40/0xa0 [dm_persistent_data]
 [&lt;ffffffffa033304c&gt;] sm_metadata_count_is_more_than_one+0x8c/0xc0 [dm_persistent_data]
 [&lt;ffffffffa0333825&gt;] dm_tm_shadow_block+0x65/0x110 [dm_persistent_data]
 [&lt;ffffffffa0331b00&gt;] sm_ll_mutate+0x80/0x300 [dm_persistent_data]
 [&lt;ffffffffa0330e60&gt;] ? set_ref_count+0x10/0x10 [dm_persistent_data]
 [&lt;ffffffffa0331dba&gt;] sm_ll_inc+0x1a/0x20 [dm_persistent_data]
 [&lt;ffffffffa0332270&gt;] sm_disk_new_block+0x60/0x80 [dm_persistent_data]
 [&lt;ffffffff81520036&gt;] ? down_write+0x16/0x40
 [&lt;ffffffffa001e5c4&gt;] dm_pool_alloc_data_block+0x54/0x80 [dm_thin_pool]
 [&lt;ffffffffa001b23c&gt;] alloc_data_block+0x9c/0x130 [dm_thin_pool]
 [&lt;ffffffffa001c27e&gt;] provision_block+0x4e/0x180 [dm_thin_pool]
 [&lt;ffffffffa001fe9a&gt;] ? dm_thin_find_block+0x6a/0x110 [dm_thin_pool]
 [&lt;ffffffffa001c57a&gt;] process_bio+0x1ca/0x1f0 [dm_thin_pool]
 [&lt;ffffffff8111e2ed&gt;] ? mempool_free+0x8d/0xa0
 [&lt;ffffffffa001d755&gt;] process_deferred_bios+0xc5/0x230 [dm_thin_pool]
 [&lt;ffffffffa001d911&gt;] do_worker+0x51/0x60 [dm_thin_pool]
 [&lt;ffffffff81067872&gt;] process_one_work+0x182/0x3b0
 [&lt;ffffffff81068c90&gt;] worker_thread+0x120/0x3a0
 [&lt;ffffffff81068b70&gt;] ? manage_workers+0x160/0x160
 [&lt;ffffffff8106eb2e&gt;] kthread+0xce/0xe0
 [&lt;ffffffff8106ea60&gt;] ? kthread_freezable_should_stop+0x70/0x70
 [&lt;ffffffff8152af6c&gt;] ret_from_fork+0x7c/0xb0
 [&lt;ffffffff8106ea60&gt;] ? kthread_freezable_should_stop+0x70/0x70
 [&lt;ffffffff8152af6c&gt;] ret_from_fork+0x7c/0xb0
 [&lt;ffffffff8106ea60&gt;] ? kthread_freezable_should_stop+0x70/0x70

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

</content>
</entry>
<entry>
<title>dm array: fix a reference counting bug in shadow_ablock</title>
<updated>2013-12-20T15:49:04Z</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2013-12-13T14:55:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7a3b9049fe0fa103b836bb706077de0e2a9c01aa'/>
<id>urn:sha1:7a3b9049fe0fa103b836bb706077de0e2a9c01aa</id>
<content type='text'>
commit ed9571f0cf1fe09d3506302610f3ccdfa1d22c4a upstream.

An old array block could have its reference count decremented below
zero when it is being replaced in the btree by a new array block.

The fix is to increment the old ablock's reference count just before
inserting a new ablock into the btree.

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 array: fix bug in growing array</title>
<updated>2013-12-04T19:05:27Z</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2013-10-30T11:19:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=884d5952afcbee9d56961663051390dda586107f'/>
<id>urn:sha1:884d5952afcbee9d56961663051390dda586107f</id>
<content type='text'>
commit 9c1d4de56066e4d6abc66ec188faafd7b303fb08 upstream.

Entries would be lost if the old tail block was partially filled.

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 space map: optimise sm_ll_dec and sm_ll_inc</title>
<updated>2013-08-23T13:02:14Z</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2013-08-09T12:04:56Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f722063ee01c0060488e1000006405449451cfa0'/>
<id>urn:sha1:f722063ee01c0060488e1000006405449451cfa0</id>
<content type='text'>
Prior to this patch these methods did a lookup followed by an insert.
Instead they now call a common mutate function that adjusts the value
according to a callback function.  This avoids traversing the data
structures twice and hence improves performance.

Also factor out sm_ll_lookup_big_ref_count() for use by both
sm_ll_lookup() and sm_ll_mutate().

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 btree: prefetch child nodes when walking tree for a dm_btree_del</title>
<updated>2013-08-23T13:02:14Z</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2013-08-09T11:59:30Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=04f17c802f447e76d13ade5bb78fbbf34baef0f8'/>
<id>urn:sha1:04f17c802f447e76d13ade5bb78fbbf34baef0f8</id>
<content type='text'>
dm-btree now takes advantage of dm-bufio's ability to prefetch data via
dm_bm_prefetch().  Prior to this change many btree node visits were
causing a synchronous read.

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 btree: use pop_frame in dm_btree_del to cleanup code</title>
<updated>2013-08-23T13:02:14Z</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2013-08-09T11:48:42Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cd5acf0b445030cd8b5bfd818f464997652485e5'/>
<id>urn:sha1:cd5acf0b445030cd8b5bfd818f464997652485e5</id>
<content type='text'>
Remove a visited leaf straight away from the stack, rather than
marking all it's children as visited and letting it get removed on the
next iteration.  May also offer a micro optimisation in dm_btree_del.

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 metadata: add space map threshold callback</title>
<updated>2013-05-10T13:37:20Z</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2013-05-10T13:37:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2fc48021f4afdd109b9e52b6eef5db89ca80bac7'/>
<id>urn:sha1:2fc48021f4afdd109b9e52b6eef5db89ca80bac7</id>
<content type='text'>
Add a threshold callback to dm persistent data space maps.

Signed-off-by: Joe Thornber &lt;ejt@redhat.com&gt;
Signed-off-by: Alasdair G Kergon &lt;agk@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm persistent data: add threshold callback to space map</title>
<updated>2013-05-10T13:37:20Z</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2013-05-10T13:37:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7c3d3f2a87b01ff167a5f048285d5e3dee920235'/>
<id>urn:sha1:7c3d3f2a87b01ff167a5f048285d5e3dee920235</id>
<content type='text'>
Add a threshold callback function to the persistent data space map
interface for a subsequent patch to use.

dm-thin and dm-cache are interested in knowing when they're getting
low on metadata or data blocks.  This patch introduces a new method
for registering a callback against a threshold.

Signed-off-by: Joe Thornber &lt;ejt@redhat.com&gt;
Signed-off-by: Alasdair G Kergon &lt;agk@redhat.com&gt;
</content>
</entry>
</feed>
