<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/device-mapper.h, branch v4.1.29</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.1.29</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.1.29'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2016-07-11T03:06:54+00:00</updated>
<entry>
<title>dm snapshot: disallow the COW and origin devices from being identical</title>
<updated>2016-07-11T03:06:54+00:00</updated>
<author>
<name>DingXiang</name>
<email>dingxiang@huawei.com</email>
</author>
<published>2016-02-02T04:29:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b5ba0d06632445b3810b50093cd22a2ab06900de'/>
<id>urn:sha1:b5ba0d06632445b3810b50093cd22a2ab06900de</id>
<content type='text'>
[ Upstream commit 4df2bf466a9c9c92f40d27c4aa9120f4e8227bfc ]

Otherwise loading a "snapshot" table using the same device for the
origin and COW devices, e.g.:

echo "0 20971520 snapshot 253:3 253:3 P 8" | dmsetup create snap

will trigger:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000098
[ 1958.979934] IP: [&lt;ffffffffa040efba&gt;] dm_exception_store_set_chunk_size+0x7a/0x110 [dm_snapshot]
[ 1958.989655] PGD 0
[ 1958.991903] Oops: 0000 [#1] SMP
...
[ 1959.059647] CPU: 9 PID: 3556 Comm: dmsetup Tainted: G          IO    4.5.0-rc5.snitm+ #150
...
[ 1959.083517] task: ffff8800b9660c80 ti: ffff88032a954000 task.ti: ffff88032a954000
[ 1959.091865] RIP: 0010:[&lt;ffffffffa040efba&gt;]  [&lt;ffffffffa040efba&gt;] dm_exception_store_set_chunk_size+0x7a/0x110 [dm_snapshot]
[ 1959.104295] RSP: 0018:ffff88032a957b30  EFLAGS: 00010246
[ 1959.110219] RAX: 0000000000000000 RBX: 0000000000000008 RCX: 0000000000000001
[ 1959.118180] RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff880329334a00
[ 1959.126141] RBP: ffff88032a957b50 R08: 0000000000000000 R09: 0000000000000001
[ 1959.134102] R10: 000000000000000a R11: f000000000000000 R12: ffff880330884d80
[ 1959.142061] R13: 0000000000000008 R14: ffffc90001c13088 R15: ffff880330884d80
[ 1959.150021] FS:  00007f8926ba3840(0000) GS:ffff880333440000(0000) knlGS:0000000000000000
[ 1959.159047] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1959.165456] CR2: 0000000000000098 CR3: 000000032f48b000 CR4: 00000000000006e0
[ 1959.173415] Stack:
[ 1959.175656]  ffffc90001c13040 ffff880329334a00 ffff880330884ed0 ffff88032a957bdc
[ 1959.183946]  ffff88032a957bb8 ffffffffa040f225 ffff880329334a30 ffff880300000000
[ 1959.192233]  ffffffffa04133e0 ffff880329334b30 0000000830884d58 00000000569c58cf
[ 1959.200521] Call Trace:
[ 1959.203248]  [&lt;ffffffffa040f225&gt;] dm_exception_store_create+0x1d5/0x240 [dm_snapshot]
[ 1959.211986]  [&lt;ffffffffa040d310&gt;] snapshot_ctr+0x140/0x630 [dm_snapshot]
[ 1959.219469]  [&lt;ffffffffa0005c44&gt;] ? dm_split_args+0x64/0x150 [dm_mod]
[ 1959.226656]  [&lt;ffffffffa0005ea7&gt;] dm_table_add_target+0x177/0x440 [dm_mod]
[ 1959.234328]  [&lt;ffffffffa0009203&gt;] table_load+0x143/0x370 [dm_mod]
[ 1959.241129]  [&lt;ffffffffa00090c0&gt;] ? retrieve_status+0x1b0/0x1b0 [dm_mod]
[ 1959.248607]  [&lt;ffffffffa0009e35&gt;] ctl_ioctl+0x255/0x4d0 [dm_mod]
[ 1959.255307]  [&lt;ffffffff813304e2&gt;] ? memzero_explicit+0x12/0x20
[ 1959.261816]  [&lt;ffffffffa000a0c3&gt;] dm_ctl_ioctl+0x13/0x20 [dm_mod]
[ 1959.268615]  [&lt;ffffffff81215eb6&gt;] do_vfs_ioctl+0xa6/0x5c0
[ 1959.274637]  [&lt;ffffffff81120d2f&gt;] ? __audit_syscall_entry+0xaf/0x100
[ 1959.281726]  [&lt;ffffffff81003176&gt;] ? do_audit_syscall_entry+0x66/0x70
[ 1959.288814]  [&lt;ffffffff81216449&gt;] SyS_ioctl+0x79/0x90
[ 1959.294450]  [&lt;ffffffff8167e4ae&gt;] entry_SYSCALL_64_fastpath+0x12/0x71
...
[ 1959.323277] RIP  [&lt;ffffffffa040efba&gt;] dm_exception_store_set_chunk_size+0x7a/0x110 [dm_snapshot]
[ 1959.333090]  RSP &lt;ffff88032a957b30&gt;
[ 1959.336978] CR2: 0000000000000098
[ 1959.344121] ---[ end trace b049991ccad1169e ]---

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1195899
Cc: stable@vger.kernel.org
Signed-off-by: Ding Xiang &lt;dingxiang@huawei.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>dm: remove unnecessary wrapper around blk_lld_busy</title>
<updated>2015-03-31T16:03:49+00:00</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2015-02-23T21:36:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=52b09914af86fa3e728175c1125c91520e437b2f'/>
<id>urn:sha1:52b09914af86fa3e728175c1125c91520e437b2f</id>
<content type='text'>
There is no need for DM to export a wrapper around the already exported
blk_lld_busy().

Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm snapshot: suspend merging snapshot when doing exception handover</title>
<updated>2015-02-27T19:53:16+00:00</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2015-02-26T16:41:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=09ee96b21456883e108c3b00597bb37ec512151b'/>
<id>urn:sha1:09ee96b21456883e108c3b00597bb37ec512151b</id>
<content type='text'>
The "dm snapshot: suspend origin when doing exception handover" commit
fixed a exception store handover bug associated with pending exceptions
to the "snapshot-origin" target.

However, a similar problem exists in snapshot merging.  When snapshot
merging is in progress, we use the target "snapshot-merge" instead of
"snapshot-origin".  Consequently, during exception store handover, we
must find the snapshot-merge target and suspend its associated
mapped_device.

To avoid lockdep warnings, the target must be suspended and resumed
without holding _origins_lock.

Introduce a dm_hold() function that grabs a reference on a
mapped_device, but unlike dm_get(), it doesn't crash if the device has
the DMF_FREEING flag set, it returns an error in this case.

In snapshot_resume() we grab the reference to the origin device using
dm_hold() while holding _origins_lock (_origins_lock guarantees that the
device won't disappear).  Then we release _origins_lock, suspend the
device and grab _origins_lock again.

NOTE to stable@ people:
When backporting to kernels 3.18 and older, use dm_internal_suspend and
dm_internal_resume instead of dm_internal_suspend_fast and
dm_internal_resume_fast.

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>dm: allocate requests in target when stacking on blk-mq devices</title>
<updated>2015-02-09T18:06:47+00:00</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2014-12-18T02:08:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e5863d9ad754926e7d3f38b43ac8bd48ef73b097'/>
<id>urn:sha1:e5863d9ad754926e7d3f38b43ac8bd48ef73b097</id>
<content type='text'>
For blk-mq request-based DM the responsibility of allocating a cloned
request is transfered from DM core to the target type.  Doing so
enables the cloned request to be allocated from the appropriate
blk-mq request_queue's pool (only the DM target, e.g. multipath, can
know which block device to send a given cloned request to).

Care was taken to preserve compatibility with old-style block request
completion that requires request-based DM _not_ acquire the clone
request's queue lock in the completion path.  As such, there are now 2
different request-based DM target_type interfaces:
1) the original .map_rq() interface will continue to be used for
   non-blk-mq devices -- the preallocated clone request is passed in
   from DM core.
2) a new .clone_and_map_rq() and .release_clone_rq() will be used for
   blk-mq devices -- blk_get_request() and blk_put_request() are used
   respectively from these hooks.

dm_table_set_type() was updated to detect if the request-based target is
being stacked on blk-mq devices, if so DM_TYPE_MQ_REQUEST_BASED is set.
DM core disallows switching the DM table's type after it is set.  This
means that there is no mixing of non-blk-mq and blk-mq devices within
the same request-based DM table.

[This patch was started by Keith and later heavily modified by Mike]

Tested-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Signed-off-by: Keith Busch &lt;keith.busch@intel.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm: remove exports for request-based interfaces without external callers</title>
<updated>2015-02-09T17:59:48+00:00</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2014-12-16T23:44:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dbf9782c1078c537831201c73ac60c9623ae9370'/>
<id>urn:sha1:dbf9782c1078c537831201c73ac60c9623ae9370</id>
<content type='text'>
Remove exports for dm_dispatch_request, dm_requeue_unmapped_request,
and dm_kill_unmapped_request.

Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm: add presuspend_undo hook to target_type</title>
<updated>2014-11-19T16:24:59+00:00</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2014-10-29T00:13:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d67ee213fa5700c7da526fe5bcccd485cfa63d8b'/>
<id>urn:sha1:d67ee213fa5700c7da526fe5bcccd485cfa63d8b</id>
<content type='text'>
The DM thin-pool target now must undo the changes performed during
pool_presuspend() so introduce presuspend_undo hook in target_type.

Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Acked-by: Joe Thornber &lt;ejt@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm: remove symbol export for dm_set_device_limits</title>
<updated>2014-06-04T13:46:34+00:00</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2014-06-03T14:30:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=11f0431be2f99c574a65c6dfc0ca205511500f29'/>
<id>urn:sha1:11f0431be2f99c574a65c6dfc0ca205511500f29</id>
<content type='text'>
There is no need for code other than DM core to use dm_set_device_limits
so remove its EXPORT_SYMBOL_GPL.  Also, cleanup a couple whitespace nits.

Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>dm: introduce dm_accept_partial_bio</title>
<updated>2014-06-03T17:44:06+00:00</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2014-03-14T22:41:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1dd40c3ecd9b8a4ab91dbf2e6ce10b82a3b5ae63'/>
<id>urn:sha1:1dd40c3ecd9b8a4ab91dbf2e6ce10b82a3b5ae63</id>
<content type='text'>
The function dm_accept_partial_bio allows the target to specify how many
sectors of the current bio it will process.  If the target only wants to
accept part of the bio, it calls dm_accept_partial_bio and the DM core
sends the rest of the data in next bio.

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 table: add dm_table_run_md_queue_async</title>
<updated>2014-03-27T20:56:24+00:00</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2014-02-28T14:33:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9974fa2c6a7d470ca3c201fe7dbac64bf4dd8d2a'/>
<id>urn:sha1:9974fa2c6a7d470ca3c201fe7dbac64bf4dd8d2a</id>
<content type='text'>
Introduce dm_table_run_md_queue_async() to run the request_queue of the
mapped_device associated with a request-based DM table.

Also add dm_md_get_queue() wrapper to extract the request_queue from a
mapped_device.

Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Hannes Reinecke &lt;hare@suse.de&gt;
Reviewed-by: Jun'ichi Nomura &lt;j-nomura@ce.jp.nec.com&gt;
</content>
</entry>
<entry>
<title>dm: remove dm_get_mapinfo</title>
<updated>2014-03-27T20:56:24+00:00</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2014-03-03T22:43:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d70ab4fb723cf7acfa656cb2ad1e75be7ed94bef'/>
<id>urn:sha1:d70ab4fb723cf7acfa656cb2ad1e75be7ed94bef</id>
<content type='text'>
Remove dm_get_mapinfo() because no target uses it.  Targets can allocate
per-bio data using ti-&gt;per_bio_data_size, this is much more flexible
than union map_info.

Leave union map_info only for the request-based multipath target's use.
Also delete the unused "unsigned long long ll" field of union map_info.

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