<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/md/dm-thin-metadata.c, branch linux-4.0.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.0.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.0.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2015-02-09T18:06:49Z</updated>
<entry>
<title>dm thin metadata: remove unused dm_pool_get_data_block_size()</title>
<updated>2015-02-09T18:06:49Z</updated>
<author>
<name>Rickard Strandqvist</name>
</author>
<published>2015-01-01T17:52:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9cb1397d585c28c2acff06a6002fc2c8db19a80d'/>
<id>urn:sha1:9cb1397d585c28c2acff06a6002fc2c8db19a80d</id>
<content type='text'>
The thin-pool target doesn't display the data block size as part of
its table status, unlike the dm-cache target, so there is no need for
dm_pool_get_data_block_size().

This was found using cppcheck.

Signed-off-by: Rickard Strandqvist &lt;rickard_strandqvist@spectrumdigital.se&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm thin: prefetch missing metadata pages</title>
<updated>2014-11-10T20:25:27Z</updated>
<author>
<name>Joe Thornber</name>
</author>
<published>2014-10-06T14:28:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8a01a6af75f839ff8eb25dab69b49224e855bfa1'/>
<id>urn:sha1:8a01a6af75f839ff8eb25dab69b49224e855bfa1</id>
<content type='text'>
Prefetch metadata at the start of the worker thread and then again every
128th bio processed from the deferred list.

Signed-off-by: Joe Thornber &lt;ejt@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm thin metadata: change dm_thin_find_block to allow blocking, but not issuing, IO</title>
<updated>2014-11-10T20:25:26Z</updated>
<author>
<name>Joe Thornber</name>
</author>
<published>2014-10-06T14:24:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e5cfc69a513cdc9d9e753c5ce07f0cc6b496bfd3'/>
<id>urn:sha1:e5cfc69a513cdc9d9e753c5ce07f0cc6b496bfd3</id>
<content type='text'>
This change is a prerequisite for allowing metadata to be prefetched.

Signed-off-by: Joe Thornber &lt;ejt@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm thin metadata: do not allow the data block size to change</title>
<updated>2014-07-15T18:05:26Z</updated>
<author>
<name>Mike Snitzer</name>
</author>
<published>2014-07-14T20:35:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9aec8629ec829fc9403788cd959e05dd87988bd1'/>
<id>urn:sha1:9aec8629ec829fc9403788cd959e05dd87988bd1</id>
<content type='text'>
The block size for the thin-pool's data device must remained fixed for
the life of the thin-pool.  Disallow any attempt to change the
thin-pool's data block size.

It should be noted that attempting to change the data block size via
thin-pool table reload will be ignored as a side-effect of the thin-pool
handover that the thin-pool target does during thin-pool table reload.

Here is an example outcome of attempting to load a thin-pool table that
reduced the thin-pool's data block size from 1024K to 512K.

Before:
kernel: device-mapper: thin: 253:4: growing the data device from 204800 to 409600 blocks

After:
kernel: device-mapper: thin metadata: changing the data block size (from 2048 to 1024) is not supported
kernel: device-mapper: table: 253:4: thin-pool: Error creating metadata object
kernel: device-mapper: ioctl: error adding target to table

Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Acked-by: Joe Thornber &lt;ejt@redhat.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>dm: take care to copy the space map roots before locking the superblock</title>
<updated>2014-03-27T20:56:23Z</updated>
<author>
<name>Joe Thornber</name>
</author>
<published>2014-03-27T14:13:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5a32083d03fb543f63489b2946c4948398579ba0'/>
<id>urn:sha1:5a32083d03fb543f63489b2946c4948398579ba0</id>
<content type='text'>
In theory copying the space map root can fail, but in practice it never
does because we're careful to check what size buffer is needed.

But make certain we're able to copy the space map roots before
locking the superblock.

Signed-off-by: Joe Thornber &lt;ejt@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Cc: stable@vger.kernel.org # drop dm-era and dm-cache changes as needed
</content>
</entry>
<entry>
<title>dm thin: ensure user takes action to validate data and metadata consistency</title>
<updated>2014-03-05T20:25:35Z</updated>
<author>
<name>Mike Snitzer</name>
</author>
<published>2014-02-14T16:58:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=07f2b6e0382ec4c59887d5954683f1a0b265574e'/>
<id>urn:sha1:07f2b6e0382ec4c59887d5954683f1a0b265574e</id>
<content type='text'>
If a thin metadata operation fails the current transaction will abort,
whereby causing potential for IO layers up the stack (e.g. filesystems)
to have data loss.  As such, set THIN_METADATA_NEEDS_CHECK_FLAG in the
thin metadata's superblock which:
1) requires the user verify the thin metadata is consistent (e.g. use
   thin_check, etc)
2) suggests the user verify the thin data is consistent (e.g. use fsck)

The only way to clear the superblock's THIN_METADATA_NEEDS_CHECK_FLAG is
to run thin_repair.

On metadata operation failure: abort current metadata transaction, set
pool in read-only mode, and now set the needs_check flag.

As part of this change, constraints are introduced or relaxed:
* don't allow a pool to transition to write mode if needs_check is set
* don't allow data or metadata space to be resized if needs_check is set
* if a thin pool's metadata space is exhausted: the kernel will now
  force the user to take the pool offline for repair before the kernel
  will allow the metadata space to be extended.

Also, update Documentation to include information about when the thin
provisioning target commits metadata, how it handles metadata failures
and running out of space.

Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Joe Thornber &lt;ejt@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm thin: allow metadata space larger than supported to go unused</title>
<updated>2014-02-27T16:49:08Z</updated>
<author>
<name>Mike Snitzer</name>
</author>
<published>2014-02-13T04:58:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7d48935eff401bb7970e73e822871a10e3643df1'/>
<id>urn:sha1:7d48935eff401bb7970e73e822871a10e3643df1</id>
<content type='text'>
It was always intended that a user could provide a thin metadata device
that is larger than the max supported by the on-disk format.  The extra
space would just go unused.

Unfortunately that never worked.  If the user attempted to use a larger
metadata device on creation they would get an error like the following:

 device-mapper: space map common: space map too large
 device-mapper: transaction manager: couldn't create metadata space map
 device-mapper: thin metadata: tm_create_with_sm failed
 device-mapper: table: 252:17: thin-pool: Error creating metadata object
 device-mapper: ioctl: error adding target to table

Fix this by allowing the initial metadata space map creation to cap its
size at the max number of blocks supported (DM_SM_METADATA_MAX_BLOCKS).
get_metadata_dev_size() must also impose DM_SM_METADATA_MAX_BLOCKS (via
THIN_METADATA_MAX_SECTORS), otherwise extending metadata would cap at
THIN_METADATA_MAX_SECTORS_WARNING (which is larger than supported).

Also, the calculation for THIN_METADATA_MAX_SECTORS didn't account for
the sizeof the disk_bitmap_header.  So the supported maximum metadata
size is a bit smaller (reduced from 33423360 to 33292800 sectors).

Lastly, remove the "excess space will not be used" warning message from
get_metadata_dev_size(); it resulted in printing the warning multiple
times.  Factor out warn_if_metadata_device_too_big(), call it from
pool_ctr() and maybe_resize_metadata_dev().

Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Acked-by: Joe Thornber &lt;ejt@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm thin: avoid metadata commit if a pool's thin devices haven't changed</title>
<updated>2014-02-17T16:00:05Z</updated>
<author>
<name>Mike Snitzer</name>
</author>
<published>2014-02-06T11:08:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4d1662a30dde6e545086fe0e8fd7e474c4e0b639'/>
<id>urn:sha1:4d1662a30dde6e545086fe0e8fd7e474c4e0b639</id>
<content type='text'>
Commit 905e51b ("dm thin: commit outstanding data every second")
introduced a periodic commit.  This commit occurs regardless of whether
any thin devices have made changes.

Fix the periodic commit to check if any of a pool's thin devices have
changed using dm_pool_changed_this_transaction().

Reported-by: Alexander Larsson &lt;alexl@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Acked-by: Joe Thornber &lt;ejt@redhat.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>dm thin: fix discard support to a previously shared block</title>
<updated>2014-01-07T15:11:43Z</updated>
<author>
<name>Joe Thornber</name>
</author>
<published>2013-12-17T17:09:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=19fa1a6756ed9e92daa9537c03b47d6b55cc2316'/>
<id>urn:sha1:19fa1a6756ed9e92daa9537c03b47d6b55cc2316</id>
<content type='text'>
If a snapshot is created and later deleted the origin dm_thin_device's
snapshotted_time will have been updated to reflect the snapshot's
creation time.  The 'shared' flag in the dm_thin_lookup_result struct
returned from dm_thin_find_block() is an approximation based on
snapshotted_time -- this is done to avoid 0(n), or worse, time
complexity.  In this case, the shared flag would be true.

But because the 'shared' flag reflects an approximation a block can be
incorrectly assumed to be shared (e.g. false positive for 'shared'
because the snapshot no longer exists).  This could result in discards
issued to a thin device not being passed down to the pool's underlying
data device.

To fix this we double check that a thin block is really still in-use
after a mapping is removed using dm_pool_block_is_used().  If the
reference count for a block is now zero the discard is allowed to be
passed down.

Also add a 'definitely_not_shared' member to the dm_thin_new_mapping
structure -- reflects that the 'shared' flag in the response from
dm_thin_find_block() can only be held as definitive if false is
returned.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1043527

Signed-off-by: Joe Thornber &lt;ejt@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>dm thin: allow pool in read-only mode to transition to read-write mode</title>
<updated>2013-12-10T21:35:13Z</updated>
<author>
<name>Joe Thornber</name>
</author>
<published>2013-12-04T21:58:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9b7aaa64f96f7ca280d75326fca42f42017b89ef'/>
<id>urn:sha1:9b7aaa64f96f7ca280d75326fca42f42017b89ef</id>
<content type='text'>
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;
Cc: stable@vger.kernel.org
</content>
</entry>
</feed>
