<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/device-mapper.h, branch v4.4.284</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.284</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.4.284'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2021-03-03T15:44:21Z</updated>
<entry>
<title>block: Move SECTOR_SIZE and SECTOR_SHIFT definitions into &lt;linux/blkdev.h&gt;</title>
<updated>2021-03-03T15:44:21Z</updated>
<author>
<name>Bart Van Assche</name>
<email>bart.vanassche@wdc.com</email>
</author>
<published>2018-03-14T22:48:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d094b3d83040c8856dee73c3eec2d33f01e7d266'/>
<id>urn:sha1:d094b3d83040c8856dee73c3eec2d33f01e7d266</id>
<content type='text'>
commit 233bde21aa43516baa013ef7ac33f3427056db3e upstream.

It happens often while I'm preparing a patch for a block driver that
I'm wondering: is a definition of SECTOR_SIZE and/or SECTOR_SHIFT
available for this driver? Do I have to introduce definitions of these
constants before I can use these constants? To avoid this confusion,
move the existing definitions of SECTOR_SIZE and SECTOR_SHIFT into the
&lt;linux/blkdev.h&gt; header file such that these become available for all
block drivers. Make the SECTOR_SIZE definition in the uapi msdos_fs.h
header file conditional to avoid that including that header file after
&lt;linux/blkdev.h&gt; causes the compiler to complain about a SECTOR_SIZE
redefinition.

Note: the SECTOR_SIZE / SECTOR_SHIFT / SECTOR_BITS definitions have
not been removed from uapi header files nor from NAND drivers in
which these constants are used for another purpose than converting
block layer offsets and sizes into a number of sectors.

Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Mike Snitzer &lt;snitzer@redhat.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: Nitin Gupta &lt;ngupta@vflare.org&gt;
Reviewed-by: Sergey Senozhatsky &lt;sergey.senozhatsky@gmail.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Reviewed-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Bart Van Assche &lt;bart.vanassche@wdc.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>dm: fix to_sector() for 32bit</title>
<updated>2019-03-23T07:44:38Z</updated>
<author>
<name>NeilBrown</name>
<email>neil@brown.name</email>
</author>
<published>2019-01-06T10:06:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cbb0f82ebbc46bd6c7a395636c57eddbc6316dfe'/>
<id>urn:sha1:cbb0f82ebbc46bd6c7a395636c57eddbc6316dfe</id>
<content type='text'>
commit 0bdb50c531f7377a9da80d3ce2d61f389c84cb30 upstream.

A dm-raid array with devices larger than 4GB won't assemble on
a 32 bit host since _check_data_dev_sectors() was added in 4.16.
This is because to_sector() treats its argument as an "unsigned long"
which is 32bits (4GB) on a 32bit host.  Using "unsigned long long"
is more correct.

Kernels as early as 4.2 can have other problems due to to_sector()
being used on the size of a device.

Fixes: 0cf4503174c1 ("dm raid: add support for the MD RAID0 personality")
cc: stable@vger.kernel.org (v4.2+)
Reported-and-tested-by: Guillaume Perréal &lt;gperreal@free.fr&gt;
Signed-off-by: NeilBrown &lt;neil@brown.name&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 snapshot: disallow the COW and origin devices from being identical</title>
<updated>2016-04-12T16:08:39Z</updated>
<author>
<name>DingXiang</name>
<email>dingxiang@huawei.com</email>
</author>
<published>2016-02-02T04:29:18Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=15c3af026b6e66ca2d9566d862af7e2fd7943a40'/>
<id>urn:sha1:15c3af026b6e66ca2d9566d862af7e2fd7943a40</id>
<content type='text'>
commit 4df2bf466a9c9c92f40d27c4aa9120f4e8227bfc upstream.

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
Signed-off-by: Ding Xiang &lt;dingxiang@huawei.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: refactor ioctl handling</title>
<updated>2015-10-31T23:05:59Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2015-10-15T12:10:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e56f81e0b01ef4e45292d8c1e19edd4d09724e14'/>
<id>urn:sha1:e56f81e0b01ef4e45292d8c1e19edd4d09724e14</id>
<content type='text'>
This moves the call to blkdev_ioctl and the argument checking to DM core
code, and only leaves a callout to find the block device to operate on
in the targets.  This simplifies the code and allows us to pass through
ioctl-like command using other methods in the next patch.

Also split out a helper around calling the prepare_ioctl method that
will be reused for persistent reservation handling.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>block: kill merge_bvec_fn() completely</title>
<updated>2015-08-13T18:31:57Z</updated>
<author>
<name>Kent Overstreet</name>
<email>kent.overstreet@gmail.com</email>
</author>
<published>2015-04-28T06:48:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8ae126660fddbeebb9251a174e6fa45b6ad8f932'/>
<id>urn:sha1:8ae126660fddbeebb9251a174e6fa45b6ad8f932</id>
<content type='text'>
As generic_make_request() is now able to handle arbitrarily sized bios,
it's no longer necessary for each individual block driver to define its
own -&gt;merge_bvec_fn() callback. Remove every invocation completely.

Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Lars Ellenberg &lt;drbd-dev@lists.linbit.com&gt;
Cc: drbd-user@lists.linbit.com
Cc: Jiri Kosina &lt;jkosina@suse.cz&gt;
Cc: Yehuda Sadeh &lt;yehuda@inktank.com&gt;
Cc: Sage Weil &lt;sage@inktank.com&gt;
Cc: Alex Elder &lt;elder@kernel.org&gt;
Cc: ceph-devel@vger.kernel.org
Cc: Alasdair Kergon &lt;agk@redhat.com&gt;
Cc: Mike Snitzer &lt;snitzer@redhat.com&gt;
Cc: dm-devel@redhat.com
Cc: Neil Brown &lt;neilb@suse.de&gt;
Cc: linux-raid@vger.kernel.org
Cc: Christoph Hellwig &lt;hch@infradead.org&gt;
Cc: "Martin K. Petersen" &lt;martin.petersen@oracle.com&gt;
Acked-by: NeilBrown &lt;neilb@suse.de&gt; (for the 'md' bits)
Acked-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Kent Overstreet &lt;kent.overstreet@gmail.com&gt;
[dpark: also remove -&gt;merge_bvec_fn() in dm-thin as well as
 dm-era-target, and resolve merge conflicts]
Signed-off-by: Dongsu Park &lt;dpark@posteo.net&gt;
Signed-off-by: Ming Lin &lt;ming.l@ssi.samsung.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>dm: remove unnecessary wrapper around blk_lld_busy</title>
<updated>2015-03-31T16:03:49Z</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2015-02-23T21:36:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/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:16Z</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2015-02-26T16:41:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/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:47Z</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2014-12-18T02:08:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/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:48Z</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2014-12-16T23:44:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/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:59Z</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2014-10-29T00:13:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/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>
</feed>
