<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/md/dm-thin.c, branch v4.11.5</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.11.5</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.11.5'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2017-05-20T12:49:44+00:00</updated>
<entry>
<title>dm thin: fix a memory leak when passing discard bio down</title>
<updated>2017-05-20T12:49:44+00:00</updated>
<author>
<name>Dennis Yang</name>
<email>dennisyang@qnap.com</email>
</author>
<published>2017-04-18T07:27:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=34224e0e1c3141c11c8176be7c14a0360ee9bfe1'/>
<id>urn:sha1:34224e0e1c3141c11c8176be7c14a0360ee9bfe1</id>
<content type='text'>
commit 948f581a53b704b984aa20df009f0a2b4cf7f907 upstream.

dm-thin does not free the discard_parent bio after all chained sub
bios finished. The following kmemleak report could be observed after
pool with discard_passdown option processes discard bios in
linux v4.11-rc7. To fix this, we drop the discard_parent bio reference
when its endio (passdown_endio) called.

unreferenced object 0xffff8803d6b29700 (size 256):
  comm "kworker/u8:0", pid 30349, jiffies 4379504020 (age 143002.776s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    01 00 00 00 00 00 00 f0 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;ffffffff81a5efd9&gt;] kmemleak_alloc+0x49/0xa0
    [&lt;ffffffff8114ec34&gt;] kmem_cache_alloc+0xb4/0x100
    [&lt;ffffffff8110eec0&gt;] mempool_alloc_slab+0x10/0x20
    [&lt;ffffffff8110efa5&gt;] mempool_alloc+0x55/0x150
    [&lt;ffffffff81374939&gt;] bio_alloc_bioset+0xb9/0x260
    [&lt;ffffffffa018fd20&gt;] process_prepared_discard_passdown_pt1+0x40/0x1c0 [dm_thin_pool]
    [&lt;ffffffffa018b409&gt;] break_up_discard_bio+0x1a9/0x200 [dm_thin_pool]
    [&lt;ffffffffa018b484&gt;] process_discard_cell_passdown+0x24/0x40 [dm_thin_pool]
    [&lt;ffffffffa018b24d&gt;] process_discard_bio+0xdd/0xf0 [dm_thin_pool]
    [&lt;ffffffffa018ecf6&gt;] do_worker+0xa76/0xd50 [dm_thin_pool]
    [&lt;ffffffff81086239&gt;] process_one_work+0x139/0x370
    [&lt;ffffffff810867b1&gt;] worker_thread+0x61/0x450
    [&lt;ffffffff8108b316&gt;] kthread+0xd6/0xf0
    [&lt;ffffffff81a6cd1f&gt;] ret_from_fork+0x3f/0x70
    [&lt;ffffffffffffffff&gt;] 0xffffffffffffffff

Signed-off-by: Dennis Yang &lt;dennisyang@qnap.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>block: Use pointer to backing_dev_info from request_queue</title>
<updated>2017-02-02T15:20:48+00:00</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2017-02-02T14:56:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dc3b17cc8bf21307c7e076e7c778d5db756f7871'/>
<id>urn:sha1:dc3b17cc8bf21307c7e076e7c778d5db756f7871</id>
<content type='text'>
We will want to have struct backing_dev_info allocated separately from
struct request_queue. As the first step add pointer to backing_dev_info
to request_queue and convert all users touching it. No functional
changes in this patch.

Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>block: add a op_is_flush helper</title>
<updated>2017-01-27T16:01:45+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2017-01-27T15:30:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f73f44eb00cb136990cfb7d40e436c13d7669ec8'/>
<id>urn:sha1:f73f44eb00cb136990cfb7d40e436c13d7669ec8</id>
<content type='text'>
This centralizes the checks for bios that needs to be go into the flush
state machine.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Reviewed-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>block: rename bio bi_rw to bi_opf</title>
<updated>2016-08-07T20:41:02+00:00</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@fb.com</email>
</author>
<published>2016-08-05T21:35:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1eff9d322a444245c67515edb52bc0eb68374aa8'/>
<id>urn:sha1:1eff9d322a444245c67515edb52bc0eb68374aa8</id>
<content type='text'>
Since commit 63a4cc24867d, bio-&gt;bi_rw contains flags in the lower
portion and the op code in the higher portions. This means that
old code that relies on manually setting bi_rw is most likely
going to be broken. Instead of letting that brokeness linger,
rename the member, to force old and out-of-tree code to break
at compile time instead of at runtime.

No intended functional changes in this commit.

Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>dm thin: fix a race condition between discarding and provisioning a block</title>
<updated>2016-07-20T16:43:35+00:00</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2016-07-01T13:00:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2a0fbffb1e50939a969d5efe495667a3aa0f72f7'/>
<id>urn:sha1:2a0fbffb1e50939a969d5efe495667a3aa0f72f7</id>
<content type='text'>
The discard passdown was being issued after the block was unmapped,
which meant the block could be reprovisioned whilst the passdown discard
was still in flight.

We can only identify unshared blocks (safe to do a passdown a discard
to) once they're unmapped and their ref count hits zero.  Block ref
counts are now used to guard against concurrent allocation of these
blocks that are being discarded.  So now we unmap the block, issue
passdown discards, and the immediately increment ref counts for regions
that have been discarded via passed down (this is safe because
allocation occurs within the same thread).  We then decrement ref counts
once the passdown discard IO is complete -- signaling these blocks may
now be allocated.

This fixes the potential for corruption that was reported here:
https://www.redhat.com/archives/dm-devel/2016-June/msg00311.html

Reported-by: Dennis Yang &lt;dennisyang@qnap.com&gt;
Signed-off-by: Joe Thornber &lt;ejt@redhat.com&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
</content>
</entry>
<entry>
<title>block, drivers, fs: rename REQ_FLUSH to REQ_PREFLUSH</title>
<updated>2016-06-07T19:41:38+00:00</updated>
<author>
<name>Mike Christie</name>
<email>mchristi@redhat.com</email>
</author>
<published>2016-06-05T19:32:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=28a8f0d317bf225ff15008f5dd66ae16242dd843'/>
<id>urn:sha1:28a8f0d317bf225ff15008f5dd66ae16242dd843</id>
<content type='text'>
To avoid confusion between REQ_OP_FLUSH, which is handled by
request_fn drivers, and upper layers requesting the block layer
perform a flush sequence along with possibly a WRITE, this patch
renames REQ_FLUSH to REQ_PREFLUSH.

Signed-off-by: Mike Christie &lt;mchristi@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>dm: use bio op accessors</title>
<updated>2016-06-07T19:41:38+00:00</updated>
<author>
<name>Mike Christie</name>
<email>mchristi@redhat.com</email>
</author>
<published>2016-06-05T19:32:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e6047149db702374f240dc18bab665479e25a8cc'/>
<id>urn:sha1:e6047149db702374f240dc18bab665479e25a8cc</id>
<content type='text'>
Separate the op from the rq_flag_bits and have dm
set/get the bio using bio_set_op_attrs/bio_op.

Signed-off-by: Mike Christie &lt;mchristi@redhat.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>block discard: use bio set op accessor</title>
<updated>2016-06-07T19:41:38+00:00</updated>
<author>
<name>Mike Christie</name>
<email>mchristi@redhat.com</email>
</author>
<published>2016-06-05T19:31:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=469e3216e20a3946a292ff0414ab86de408d465e'/>
<id>urn:sha1:469e3216e20a3946a292ff0414ab86de408d465e</id>
<content type='text'>
This converts the block issue discard helper and users to use
the bio_set_op_attrs accessor and only pass in the operation flags
like REQ_SEQURE.

Signed-off-by: Mike Christie &lt;mchristi@redhat.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>block/fs/drivers: remove rw argument from submit_bio</title>
<updated>2016-06-07T19:41:38+00:00</updated>
<author>
<name>Mike Christie</name>
<email>mchristi@redhat.com</email>
</author>
<published>2016-06-05T19:31:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4e49ea4a3d276365bf7396c9b77b4d1d5923835a'/>
<id>urn:sha1:4e49ea4a3d276365bf7396c9b77b4d1d5923835a</id>
<content type='text'>
This has callers of submit_bio/submit_bio_wait set the bio-&gt;bi_rw
instead of passing it in. This makes that use the same as
generic_make_request and how we set the other bio fields.

Signed-off-by: Mike Christie &lt;mchristi@redhat.com&gt;

Fixed up fs/ext4/crypto.c

Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>dm thin: unroll issue_discard() to create longer discard bio chains</title>
<updated>2016-05-13T13:04:20+00:00</updated>
<author>
<name>Joe Thornber</name>
<email>ejt@redhat.com</email>
</author>
<published>2016-05-04T18:12:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=202bae52934d4eb79ffaebf49f49b1cc64d8e40b'/>
<id>urn:sha1:202bae52934d4eb79ffaebf49f49b1cc64d8e40b</id>
<content type='text'>
There is little benefit to doing this but it does structure DM thinp's
code to more cleanly use the __blkdev_issue_discard() interface --
particularly in passdown_double_checking_shared_status().

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