<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/block, branch v4.4-rc3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.4-rc3</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.4-rc3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-11-25T17:12:54Z</updated>
<entry>
<title>Revert "blk-flush: Queue through IO scheduler when flush not required"</title>
<updated>2015-11-25T17:12:54Z</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@fb.com</email>
</author>
<published>2015-11-25T17:12:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dcd8376c369fa8fde8269e721b14f50475dd397b'/>
<id>urn:sha1:dcd8376c369fa8fde8269e721b14f50475dd397b</id>
<content type='text'>
This reverts commit 1b2ff19e6a957b1ef0f365ad331b608af80e932e.

Jan writes:

--

Thanks for report! After some investigation I found out we allocate
elevator specific data in __get_request() only for non-flush requests. And
this is actually required since the flush machinery uses the space in
struct request for something else. Doh. So my patch is just wrong and not
easy to fix since at the time __get_request() is called we are not sure
whether the flush machinery will be used in the end. Jens, please revert
1b2ff19e6a957b1ef0f365ad331b608af80e932e. Thanks!

I'm somewhat surprised that you can reliably hit the race where flushing
gets disabled for the device just while the request is in flight. But I
guess during boot it makes some sense.

--

So let's just revert it, we can fix the queue run manually after the
fact. This race is rare enough that it didn't trigger in testing, it
requires the specific disable-while-in-flight scenario to trigger.
</content>
</entry>
<entry>
<title>block: fix blk_abort_request for blk-mq drivers</title>
<updated>2015-11-24T22:24:10Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2015-10-30T12:47:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=55ce0da1da287822e5ffb5fcd6e357180d5ba4cd'/>
<id>urn:sha1:55ce0da1da287822e5ffb5fcd6e357180d5ba4cd</id>
<content type='text'>
We only added the request to the request list for the !blk-mq case,
so we should only delete it in that case as well.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.dk/linux-block</title>
<updated>2015-11-24T18:26:30Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2015-11-24T18:26:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4ce01c518ebf6e3818abf5f4a9e1a1ef9d52f232'/>
<id>urn:sha1:4ce01c518ebf6e3818abf5f4a9e1a1ef9d52f232</id>
<content type='text'>
Pull block layer fixes from Jens Axboe:
 "A round of fixes/updates for the current series.

  This looks a little bigger than it is, but that's mainly because we
  pushed the lightnvm enabled null_blk change out of the merge window so
  it could be updated a bit.  The rest of the volume is also mostly
  lightnvm.  In particular:

   - Lightnvm.  Various fixes, additions, updates from Matias and
     Javier, as well as from Wenwei Tao.

   - NVMe:
        - Fix for potential arithmetic overflow from Keith.
        - Also from Keith, ensure that we reap pending completions from
          a completion queue before deleting it.  Fixes kernel crashes
          when resetting a device with IO pending.
        - Various little lightnvm related tweaks from Matias.

   - Fixup flushes to go through the IO scheduler, for the cases where a
     flush is not required.  Fixes a case in CFQ where we would be
     idling and not see this request, hence not break the idling.  From
     Jan Kara.

   - Use list_{first,prev,next} in elevator.c for cleaner code.  From
     Gelian Tang.

   - Fix for a warning trigger on btrfs and raid on single queue blk-mq
     devices, where we would flush plug callbacks with preemption
     disabled.  From me.

   - A mac partition validation fix from Kees Cook.

   - Two merge fixes from Ming, marked stable.  A third part is adding a
     new warning so we'll notice this quicker in the future, if we screw
     up the accounting.

   - Cleanup of thread name/creation in mtip32xx from Rasmus Villemoes"

* 'for-linus' of git://git.kernel.dk/linux-block: (32 commits)
  blk-merge: warn if figured out segment number is bigger than nr_phys_segments
  blk-merge: fix blk_bio_segment_split
  block: fix segment split
  blk-mq: fix calling unplug callbacks with preempt disabled
  mac: validate mac_partition is within sector
  mtip32xx: use formatting capability of kthread_create_on_node
  NVMe: reap completion entries when deleting queue
  lightnvm: add free and bad lun info to show luns
  lightnvm: keep track of block counts
  nvme: lightnvm: use admin queues for admin cmds
  lightnvm: missing free on init error
  lightnvm: wrong return value and redundant free
  null_blk: do not del gendisk with lightnvm
  null_blk: use device addressing mode
  null_blk: use ppa_cache pool
  NVMe: Fix possible arithmetic overflow for max segments
  blk-flush: Queue through IO scheduler when flush not required
  null_blk: register as a LightNVM device
  elevator: use list_{first,prev,next}_entry
  lightnvm: cleanup queue before target removal
  ...
</content>
</entry>
<entry>
<title>blk-merge: warn if figured out segment number is bigger than nr_phys_segments</title>
<updated>2015-11-24T03:16:55Z</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@canonical.com</email>
</author>
<published>2015-11-24T02:35:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=12e57f59ca3344a588531f68eeede45666e8a6e0'/>
<id>urn:sha1:12e57f59ca3344a588531f68eeede45666e8a6e0</id>
<content type='text'>
We had seen lots of reports of this kind issue, so add one
warnning in blk-merge, then it can be triggered easily and
avoid to depend on warning/bug from drivers.

Signed-off-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>blk-merge: fix blk_bio_segment_split</title>
<updated>2015-11-24T03:16:53Z</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@canonical.com</email>
</author>
<published>2015-11-24T02:35:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=02e707424c2eadbcda68cd38876c9f4434ca8e1a'/>
<id>urn:sha1:02e707424c2eadbcda68cd38876c9f4434ca8e1a</id>
<content type='text'>
Commit bdced438acd83a(block: setup bi_phys_segments after
splitting) introduces function of computing bio-&gt;bi_phys_segments
during bio splitting.

Unfortunately both bio-&gt;bi_seg_front_size and bio-&gt;bi_seg_back_size
arn't computed, so too many physical segments may be obtained
for one request since both the two are used to check if one segment
across two bios can be possible.

This patch fixes the issue by computing the two variables in
blk_bio_segment_split().

Fixes: bdced438acd83a(block: setup bi_phys_segments after splitting)
Reported-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Reported-by: Mark Salter &lt;msalter@redhat.com&gt;
Tested-by: Laurent Dufour &lt;ldufour@linux.vnet.ibm.com&gt;
Tested-by: Mark Salter &lt;msalter@redhat.com&gt;
Signed-off-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>block: fix segment split</title>
<updated>2015-11-24T03:16:51Z</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@canonical.com</email>
</author>
<published>2015-11-24T02:35:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=578270bfbd2803dc7b0b03fbc2ac119efbc73195'/>
<id>urn:sha1:578270bfbd2803dc7b0b03fbc2ac119efbc73195</id>
<content type='text'>
Inside blk_bio_segment_split(), previous bvec pointer(bvprvp)
always points to the iterator local variable, which is obviously
wrong, so fix it by pointing to the local variable of 'bvprv'.

Fixes: 5014c311baa2b(block: fix bogus compiler warnings in blk-merge.c)
Cc: stable@kernel.org #4.3
Reported-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Reported-by: Mark Salter &lt;msalter@redhat.com&gt;
Tested-by: Laurent Dufour &lt;ldufour@linux.vnet.ibm.com&gt;
Tested-by: Mark Salter &lt;msalter@redhat.com&gt;
Signed-off-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>blk-mq: fix calling unplug callbacks with preempt disabled</title>
<updated>2015-11-21T03:29:45Z</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@fb.com</email>
</author>
<published>2015-11-21T03:29:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b094f89ca42fbb8ce40174d5f85ca8430e499da6'/>
<id>urn:sha1:b094f89ca42fbb8ce40174d5f85ca8430e499da6</id>
<content type='text'>
Liu reported that running certain parts of xfstests threw the
following error:

BUG: sleeping function called from invalid context at mm/page_alloc.c:3190
in_atomic(): 1, irqs_disabled(): 0, pid: 6, name: kworker/u16:0
3 locks held by kworker/u16:0/6:
 #0:  ("writeback"){++++.+}, at: [&lt;ffffffff8107f083&gt;] process_one_work+0x173/0x730
 #1:  ((&amp;(&amp;wb-&gt;dwork)-&gt;work)){+.+.+.}, at: [&lt;ffffffff8107f083&gt;] process_one_work+0x173/0x730
 #2:  (&amp;type-&gt;s_umount_key#44){+++++.}, at: [&lt;ffffffff811e6805&gt;] trylock_super+0x25/0x60
CPU: 5 PID: 6 Comm: kworker/u16:0 Tainted: G           OE   4.3.0+ #3
Hardware name: Red Hat KVM, BIOS Bochs 01/01/2011
Workqueue: writeback wb_workfn (flush-btrfs-108)
 ffffffff81a3abab ffff88042e282ba8 ffffffff8130191b ffffffff81a3abab
 0000000000000c76 ffff88042e282ba8 ffff88042e27c180 ffff88042e282bd8
 ffffffff8108ed95 ffff880400000004 0000000000000000 0000000000000c76
Call Trace:
 [&lt;ffffffff8130191b&gt;] dump_stack+0x4f/0x74
 [&lt;ffffffff8108ed95&gt;] ___might_sleep+0x185/0x240
 [&lt;ffffffff8108eea2&gt;] __might_sleep+0x52/0x90
 [&lt;ffffffff811817e8&gt;] __alloc_pages_nodemask+0x268/0x410
 [&lt;ffffffff8109a43c&gt;] ? sched_clock_local+0x1c/0x90
 [&lt;ffffffff8109a6d1&gt;] ? local_clock+0x21/0x40
 [&lt;ffffffff810b9eb0&gt;] ? __lock_release+0x420/0x510
 [&lt;ffffffff810b534c&gt;] ? __lock_acquired+0x16c/0x3c0
 [&lt;ffffffff811ca265&gt;] alloc_pages_current+0xc5/0x210
 [&lt;ffffffffa0577105&gt;] ? rbio_is_full+0x55/0x70 [btrfs]
 [&lt;ffffffff810b7ed8&gt;] ? mark_held_locks+0x78/0xa0
 [&lt;ffffffff81666d50&gt;] ? _raw_spin_unlock_irqrestore+0x40/0x60
 [&lt;ffffffffa0578c0a&gt;] full_stripe_write+0x5a/0xc0 [btrfs]
 [&lt;ffffffffa0578ca9&gt;] __raid56_parity_write+0x39/0x60 [btrfs]
 [&lt;ffffffffa0578deb&gt;] run_plug+0x11b/0x140 [btrfs]
 [&lt;ffffffffa0578e33&gt;] btrfs_raid_unplug+0x23/0x70 [btrfs]
 [&lt;ffffffff812d36c2&gt;] blk_flush_plug_list+0x82/0x1f0
 [&lt;ffffffff812e0349&gt;] blk_sq_make_request+0x1f9/0x740
 [&lt;ffffffff812ceba2&gt;] ? generic_make_request_checks+0x222/0x7c0
 [&lt;ffffffff812cf264&gt;] ? blk_queue_enter+0x124/0x310
 [&lt;ffffffff812cf1d2&gt;] ? blk_queue_enter+0x92/0x310
 [&lt;ffffffff812d0ae2&gt;] generic_make_request+0x172/0x2c0
 [&lt;ffffffff812d0ad4&gt;] ? generic_make_request+0x164/0x2c0
 [&lt;ffffffff812d0ca0&gt;] submit_bio+0x70/0x140
 [&lt;ffffffffa0577b29&gt;] ? rbio_add_io_page+0x99/0x150 [btrfs]
 [&lt;ffffffffa0578a89&gt;] finish_rmw+0x4d9/0x600 [btrfs]
 [&lt;ffffffffa0578c4c&gt;] full_stripe_write+0x9c/0xc0 [btrfs]
 [&lt;ffffffffa057ab7f&gt;] raid56_parity_write+0xef/0x160 [btrfs]
 [&lt;ffffffffa052bd83&gt;] btrfs_map_bio+0xe3/0x2d0 [btrfs]
 [&lt;ffffffffa04fbd6d&gt;] btrfs_submit_bio_hook+0x8d/0x1d0 [btrfs]
 [&lt;ffffffffa05173c4&gt;] submit_one_bio+0x74/0xb0 [btrfs]
 [&lt;ffffffffa0517f55&gt;] submit_extent_page+0xe5/0x1c0 [btrfs]
 [&lt;ffffffffa0519b18&gt;] __extent_writepage_io+0x408/0x4c0 [btrfs]
 [&lt;ffffffffa05179c0&gt;] ? alloc_dummy_extent_buffer+0x140/0x140 [btrfs]
 [&lt;ffffffffa051dc88&gt;] __extent_writepage+0x218/0x3a0 [btrfs]
 [&lt;ffffffff810b7ed8&gt;] ? mark_held_locks+0x78/0xa0
 [&lt;ffffffffa051e2c9&gt;] extent_write_cache_pages.clone.0+0x2f9/0x400 [btrfs]
 [&lt;ffffffffa051e422&gt;] extent_writepages+0x52/0x70 [btrfs]
 [&lt;ffffffffa05001f0&gt;] ? btrfs_set_inode_index+0x70/0x70 [btrfs]
 [&lt;ffffffffa04fcc17&gt;] btrfs_writepages+0x27/0x30 [btrfs]
 [&lt;ffffffff81184df3&gt;] do_writepages+0x23/0x40
 [&lt;ffffffff81212229&gt;] __writeback_single_inode+0x89/0x4d0
 [&lt;ffffffff81212a60&gt;] ? writeback_sb_inodes+0x260/0x480
 [&lt;ffffffff81212a60&gt;] ? writeback_sb_inodes+0x260/0x480
 [&lt;ffffffff8121295f&gt;] ? writeback_sb_inodes+0x15f/0x480
 [&lt;ffffffff81212ad2&gt;] writeback_sb_inodes+0x2d2/0x480
 [&lt;ffffffff810b1397&gt;] ? down_read_trylock+0x57/0x60
 [&lt;ffffffff811e6805&gt;] ? trylock_super+0x25/0x60
 [&lt;ffffffff810d629f&gt;] ? rcu_read_lock_sched_held+0x4f/0x90
 [&lt;ffffffff81212d0c&gt;] __writeback_inodes_wb+0x8c/0xc0
 [&lt;ffffffff812130b5&gt;] wb_writeback+0x2b5/0x500
 [&lt;ffffffff810b7ed8&gt;] ? mark_held_locks+0x78/0xa0
 [&lt;ffffffff810660a8&gt;] ? __local_bh_enable_ip+0x68/0xc0
 [&lt;ffffffff81213362&gt;] ? wb_do_writeback+0x62/0x310
 [&lt;ffffffff812133c1&gt;] wb_do_writeback+0xc1/0x310
 [&lt;ffffffff8107c3d9&gt;] ? set_worker_desc+0x79/0x90
 [&lt;ffffffff81213842&gt;] wb_workfn+0x92/0x330
 [&lt;ffffffff8107f133&gt;] process_one_work+0x223/0x730
 [&lt;ffffffff8107f083&gt;] ? process_one_work+0x173/0x730
 [&lt;ffffffff8108035f&gt;] ? worker_thread+0x18f/0x430
 [&lt;ffffffff810802ed&gt;] worker_thread+0x11d/0x430
 [&lt;ffffffff810801d0&gt;] ? maybe_create_worker+0xf0/0xf0
 [&lt;ffffffff810801d0&gt;] ? maybe_create_worker+0xf0/0xf0
 [&lt;ffffffff810858df&gt;] kthread+0xef/0x110
 [&lt;ffffffff8108f74e&gt;] ? schedule_tail+0x1e/0xd0
 [&lt;ffffffff810857f0&gt;] ? __init_kthread_worker+0x70/0x70
 [&lt;ffffffff816673bf&gt;] ret_from_fork+0x3f/0x70
 [&lt;ffffffff810857f0&gt;] ? __init_kthread_worker+0x70/0x70

The issue is that we've got the software context pinned while
calling blk_flush_plug_list(), which flushes callbacks that
are allowed to sleep. btrfs and raid has such callbacks.

Flip the checks around a bit, so we can enable preempt a bit
earlier and flush plugs without having preempt disabled.

This only affects blk-mq driven devices, and only those that
register a single queue.

Reported-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
Tested-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
Cc: stable@kernel.org
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>mac: validate mac_partition is within sector</title>
<updated>2015-11-20T15:49:28Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2015-11-20T01:18:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=02e2a5bfebe99edcf9d694575a75032d53fe1b73'/>
<id>urn:sha1:02e2a5bfebe99edcf9d694575a75032d53fe1b73</id>
<content type='text'>
If md-&gt;signature == MAC_DRIVER_MAGIC and md-&gt;block_size == 1023, a single
512 byte sector would be read (secsize / 512). However the partition
structure would be located past the end of the buffer (secsize % 512).

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>block: protect rw_page against device teardown</title>
<updated>2015-11-19T21:47:10Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2015-11-19T21:29:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2e6edc95382cc36423aff18a237173ad62d5ab52'/>
<id>urn:sha1:2e6edc95382cc36423aff18a237173ad62d5ab52</id>
<content type='text'>
Fix use after free crashes like the following:

 general protection fault: 0000 [#1] SMP
 Call Trace:
  [&lt;ffffffffa0050216&gt;] ? pmem_do_bvec.isra.12+0xa6/0xf0 [nd_pmem]
  [&lt;ffffffffa0050ba2&gt;] pmem_rw_page+0x42/0x80 [nd_pmem]
  [&lt;ffffffff8128fd90&gt;] bdev_read_page+0x50/0x60
  [&lt;ffffffff812972f0&gt;] do_mpage_readpage+0x510/0x770
  [&lt;ffffffff8128fd20&gt;] ? I_BDEV+0x20/0x20
  [&lt;ffffffff811d86dc&gt;] ? lru_cache_add+0x1c/0x50
  [&lt;ffffffff81297657&gt;] mpage_readpages+0x107/0x170
  [&lt;ffffffff8128fd20&gt;] ? I_BDEV+0x20/0x20
  [&lt;ffffffff8128fd20&gt;] ? I_BDEV+0x20/0x20
  [&lt;ffffffff8129058d&gt;] blkdev_readpages+0x1d/0x20
  [&lt;ffffffff811d615f&gt;] __do_page_cache_readahead+0x28f/0x310
  [&lt;ffffffff811d6039&gt;] ? __do_page_cache_readahead+0x169/0x310
  [&lt;ffffffff811c5abd&gt;] ? pagecache_get_page+0x2d/0x1d0
  [&lt;ffffffff811c76f6&gt;] filemap_fault+0x396/0x530
  [&lt;ffffffff811f816e&gt;] __do_fault+0x4e/0xf0
  [&lt;ffffffff811fce7d&gt;] handle_mm_fault+0x11bd/0x1b50

Cc: &lt;stable@vger.kernel.org&gt;
Cc: Jens Axboe &lt;axboe@fb.com&gt;
Cc: Alexander Viro &lt;viro@zeniv.linux.org.uk&gt;
Reported-by: kbuild test robot &lt;lkp@intel.com&gt;
Acked-by: Matthew Wilcox &lt;willy@linux.intel.com&gt;
[willy: symmetry fixups]
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>blk-flush: Queue through IO scheduler when flush not required</title>
<updated>2015-11-16T22:23:51Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.com</email>
</author>
<published>2015-11-12T13:25:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1b2ff19e6a957b1ef0f365ad331b608af80e932e'/>
<id>urn:sha1:1b2ff19e6a957b1ef0f365ad331b608af80e932e</id>
<content type='text'>
Currently blk_insert_flush() just adds flush request to q-&gt;queue_head
when flush is not required. That completely bypasses IO scheduler so
e.g. CFQ can be idling waiting for new request to arrive and will idle
through the whole window unnecessarily. Luckily this only happens in
rare cases as usually checks in generic_make_request_checks() clear
FLUSH and FUA flags early if they are not needed.

When no flushing is actually required, we can easily fix the problem by
properly queueing the request through the IO scheduler. Ideally IO
scheduler should be also made aware of requests queued via
blk_flush_queue_rq(). However inserting flush request through IO
scheduler can have unwanted side-effects since due to flush batching
delaying the flush request in IO scheduler will delay all flush requests
possibly coming from other processes. So we keep adding the request
directly to q-&gt;queue_head.

Signed-off-by: Jan Kara &lt;jack@suse.com&gt;
Reviewed-by: Jeff Moyer &lt;jmoyer@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
</feed>
