<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/md, branch v3.14</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/md?h=v3.14</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/md?h=v3.14'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2014-03-12T17:52:00Z</updated>
<entry>
<title>dm cache: fix access beyond end of origin device</title>
<updated>2014-03-12T17:52:00Z</updated>
<author>
<name>Heinz Mauelshagen</name>
<email>heinzm@redhat.com</email>
</author>
<published>2014-03-12T15:13:39Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e893fba90c09f9b57fb97daae204ea9cc2c52fa5'/>
<id>urn:sha1:e893fba90c09f9b57fb97daae204ea9cc2c52fa5</id>
<content type='text'>
In order to avoid wasting cache space a partial block at the end of the
origin device is not cached.  Unfortunately, the check for such a
partial block at the end of the origin device was flawed.

Fix accesses beyond the end of the origin device that occured due to
attempted promotion of an undetected partial block by:

- initializing the per bio data struct to allow cache_end_io to work properly
- recognizing access to the partial block at the end of the origin device
- avoiding out of bounds access to the discard bitset

Otherwise, users can experience errors like the following:

 attempt to access beyond end of device
 dm-5: rw=0, want=20971520, limit=20971456
 ...
 device-mapper: cache: promotion failed; couldn't copy block

Signed-off-by: Heinz Mauelshagen &lt;heinzm@redhat.com&gt;
Acked-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 cache: fix truncation bug when copying a block to/from &gt;2TB fast device</title>
<updated>2014-03-12T17:49:27Z</updated>
<author>
<name>Heinz Mauelshagen</name>
<email>heinzm@redhat.com</email>
</author>
<published>2014-03-11T23:40:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8b9d96666529a979acf4825391efcc7c8a3e9f12'/>
<id>urn:sha1:8b9d96666529a979acf4825391efcc7c8a3e9f12</id>
<content type='text'>
During demotion or promotion to a cache's &gt;2TB fast device we must not
truncate the cache block's associated sector to 32bits.  The 32bit
temporary result of from_cblock() caused a 32bit multiplication when
calculating the sector of the fast device in issue_copy_real().

Use an intermediate 64bit type to store the 32bit from_cblock() to allow
for proper 64bit multiplication.

Here is an example of how this bug manifests on an ext4 filesystem:

 EXT4-fs error (device dm-0): ext4_mb_generate_buddy:756: group 17136, 32768 clusters in bitmap, 30688 in gd; block bitmap corrupt.
 JBD2: Spotted dirty metadata buffer (dev = dm-0, blocknr = 0). There's a risk of filesystem corruption in case of system crash.

Signed-off-by: Heinz Mauelshagen &lt;heinzm@redhat.com&gt;
Acked-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 space map metadata: fix refcount decrement below 0 which caused corruption</title>
<updated>2014-03-07T17:02:47Z</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2014-03-07T14:57:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cebc2de44d3bce53e46476e774126c298ca2c8a9'/>
<id>urn:sha1:cebc2de44d3bce53e46476e774126c298ca2c8a9</id>
<content type='text'>
This has been a relatively long-standing issue that wasn't nailed down
until Teng-Feng Yang's meticulous bug report to dm-devel on 3/7/2014,
see: http://www.redhat.com/archives/dm-devel/2014-March/msg00021.html

From that report:
  "When decreasing the reference count of a metadata block with its
  reference count equals 3, we will call dm_btree_remove() to remove
  this enrty from the B+tree which keeps the reference count info in
  metadata device.

  The B+tree will try to rebalance the entry of the child nodes in each
  node it traversed, and the rebalance process contains the following
  steps.

  (1) Finding the corresponding children in current node (shadow_current(s))
  (2) Shadow the children block (issue BOP_INC)
  (3) redistribute keys among children, and free children if necessary (issue BOP_DEC)

  Since the update of a metadata block's reference count could be
  recursive, we will stash these reference count update operations in
  smm-&gt;uncommitted and then process them in a FILO fashion.

  The problem is that step(3) could free the children which is created
  in step(2), so the BOP_DEC issued in step(3) will be carried out
  before the BOP_INC issued in step(2) since these BOPs will be
  processed in FILO fashion. Once the BOP_DEC from step(3) tries to
  decrease the reference count of newly shadow block, it will report
  failure for its reference equals 0 before decreasing. It looks like we
  can solve this issue by processing these BOPs in a FIFO fashion
  instead of FILO."

Commit 5b564d80 ("dm space map: disallow decrementing a reference count
below zero") changed the code to report an error for this temporary
refcount decrement below zero.  So what was previously a harmless
invalid refcount became a hard failure due to the new error path:

 device-mapper: space map common: unable to decrement a reference count below 0
 device-mapper: thin: 253:6: dm_thin_insert_block() failed: error = -22
 device-mapper: thin: 253:6: switching pool to read-only mode

This bug is in dm persistent-data code that is common to the DM thin and
cache targets.  So any users of those targets should apply this fix.

Fix this by applying recursive space map operations in FIFO order rather
than FILO.

Resolves: https://bugzilla.kernel.org/show_bug.cgi?id=68801

Reported-by: Apollon Oikonomopoulos &lt;apoikos@debian.org&gt;
Reported-by: edwillam1007@gmail.com
Reported-by: Teng-Feng Yang &lt;shinrairis@gmail.com&gt;
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 # 3.13+
</content>
</entry>
<entry>
<title>dm thin: fix noflush suspend IO queueing</title>
<updated>2014-03-05T20:26:59Z</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2014-03-03T15:52:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=738211f70a1d0c7ff7dc965395f7b8a436365ebd'/>
<id>urn:sha1:738211f70a1d0c7ff7dc965395f7b8a436365ebd</id>
<content type='text'>
i) by the time DM core calls the postsuspend hook the dm_noflush flag
has been cleared.  So the old thin_postsuspend did nothing.  We need to
use the presuspend hook instead.

ii) There was a race between bios leaving DM core and arriving in the
deferred queue.

thin_presuspend now sets a 'requeue' flag causing all bios destined for
that thin to be requeued back to DM core.  Then it requeues all held IO,
and all IO on the deferred queue (destined for that thin).  Finally
postsuspend clears the 'requeue' flag.

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: fix deadlock in __requeue_bio_list</title>
<updated>2014-03-05T20:26:58Z</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2014-03-03T15:46:42Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=18adc57779866ba451237dccca2ebf019be2fa20'/>
<id>urn:sha1:18adc57779866ba451237dccca2ebf019be2fa20</id>
<content type='text'>
The spin lock in requeue_io() was held for too long, allowing deadlock.
Don't worry, due to other issues addressed in the following "dm thin:
fix noflush suspend IO queueing" commit, this code was never called.

Fix this by taking the spin lock for a much shorter period of time.

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: fix out of data space handling</title>
<updated>2014-03-05T20:26:58Z</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2014-03-03T16:03:26Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3e1a0699095803e53072699a4a1485af7744601d'/>
<id>urn:sha1:3e1a0699095803e53072699a4a1485af7744601d</id>
<content type='text'>
Ideally a thin pool would never run out of data space; the low water
mark would trigger userland to extend the pool before we completely run
out of space.  However, many small random IOs to unprovisioned space can
consume data space at an alarming rate.  Adjust your low water mark if
you're frequently seeing "out-of-data-space" mode.

Before this fix, if data space ran out the pool would be put in
PM_READ_ONLY mode which also aborted the pool's current metadata
transaction (data loss for any changes in the transaction).  This had a
side-effect of needlessly compromising data consistency.  And retry of
queued unserviceable bios, once the data pool was resized, could
initiate changes to potentially inconsistent pool metadata.

Now when the pool's data space is exhausted transition to a new pool
mode (PM_OUT_OF_DATA_SPACE) that allows metadata to be changed but data
may not be allocated.  This allows users to remove thin volumes or
discard data to recover data space.

The pool is no longer put in PM_READ_ONLY mode in response to the pool
running out of data space.  And PM_READ_ONLY mode no longer aborts the
pool's current metadata transaction.  Also, set_pool_mode() will now
notify userspace when the pool mode is changed.

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: ensure user takes action to validate data and metadata consistency</title>
<updated>2014-03-05T20:25:35Z</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2014-02-14T16:58:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/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: synchronize the pool mode during suspend</title>
<updated>2014-03-04T16:17:51Z</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2014-02-14T23:10:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cdc2b4158405f1975f9d5205096f08430eda1c0e'/>
<id>urn:sha1:cdc2b4158405f1975f9d5205096f08430eda1c0e</id>
<content type='text'>
Commit b5330655 ("dm thin: handle metadata failures more consistently")
increased potential for the pool's mode to be changed in response to
metadata operation failures.

When the pool mode is changed it isn't synchronized with the mode in
pool_features stored in the target's context (ti-&gt;private) that is used
as the basis for (re)establishing the pool mode during resume via
bind_control_target.

It is important that we synchronize the pool mode when it is changed
otherwise the pool may experience and unexpected mode transition on the
next resume (especially if there was no new table load).

Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Acked-by: Joe Thornber &lt;ejt@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm snapshot: fix metadata corruption</title>
<updated>2014-03-03T22:58:13Z</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2014-03-03T22:19:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2c945820cab96ebf265598d998e63ef22393d0d4'/>
<id>urn:sha1:2c945820cab96ebf265598d998e63ef22393d0d4</id>
<content type='text'>
Commit 55494bf2947dccdf2 ("dm snapshot: use dm-bufio") broke snapshots.
Before that 3.14-rc1 commit, loading a snapshot's list of exceptions
involved reading exception areas one by one into ps-&gt;area and inserting
those exceptions into the hash table.  Commit 55494bf2947dccdf2 changed
it so that dm-bufio with prefetch is used to load exceptions in batchs.
Exceptions are loaded correctly, but ps-&gt;area is left uninitialized.
When a new exception is allocated, it is stored in this uninitialized
ps-&gt;area which will be written to the disk.  This causes metadata
corruption.

Fix this corruption by copying the last area that was read via dm-bufio
into ps-&gt;area.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm: fix Kconfig indentation</title>
<updated>2014-03-03T22:31:07Z</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2014-03-03T15:57:56Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c64d240df31513522901539a3206a41e9e6d00c8'/>
<id>urn:sha1:c64d240df31513522901539a3206a41e9e6d00c8</id>
<content type='text'>
Since DM_DEBUG_BLOCK_STACK_TRACING is a DM_PERSISTENT_DATA config option
move it from drivers/md/Kconfig to drivers/md/persistent-data/Kconfig.

Doing so fixes indentation for other DM config options.

Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
</feed>
