<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/block, branch v3.14.13</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>blkcg: fix use-after-free in __blkg_release_rcu() by making blkcg_gq refcnt an atomic_t</title>
<updated>2014-07-09T18:18:27+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2014-06-19T21:42:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=baa9dbe85a5ce7d415837652a14c2edac0455880'/>
<id>baa9dbe85a5ce7d415837652a14c2edac0455880</id>
<content type='text'>
commit a5049a8ae34950249a7ae94c385d7c5c98914412 upstream.

Hello,

So, this patch should do.  Joe, Vivek, can one of you guys please
verify that the oops goes away with this patch?

Jens, the original thread can be read at

  http://thread.gmane.org/gmane.linux.kernel/1720729

The fix converts blkg-&gt;refcnt from int to atomic_t.  It does some
overhead but it should be minute compared to everything else which is
going on and the involved cacheline bouncing, so I think it's highly
unlikely to cause any noticeable difference.  Also, the refcnt in
question should be converted to a perpcu_ref for blk-mq anyway, so the
atomic_t is likely to go away pretty soon anyway.

Thanks.

------- 8&lt; -------
__blkg_release_rcu() may be invoked after the associated request_queue
is released with a RCU grace period inbetween.  As such, the function
and callbacks invoked from it must not dereference the associated
request_queue.  This is clearly indicated in the comment above the
function.

Unfortunately, while trying to fix a different issue, 2a4fd070ee85
("blkcg: move bulk of blkcg_gq release operations to the RCU
callback") ignored this and added [un]locking of @blkg-&gt;q-&gt;queue_lock
to __blkg_release_rcu().  This of course can cause oops as the
request_queue may be long gone by the time this code gets executed.

  general protection fault: 0000 [#1] SMP
  CPU: 21 PID: 30 Comm: rcuos/21 Not tainted 3.15.0 #1
  Hardware name: Stratus ftServer 6400/G7LAZ, BIOS BIOS Version 6.3:57 12/25/2013
  task: ffff880854021de0 ti: ffff88085403c000 task.ti: ffff88085403c000
  RIP: 0010:[&lt;ffffffff8162e9e5&gt;]  [&lt;ffffffff8162e9e5&gt;] _raw_spin_lock_irq+0x15/0x60
  RSP: 0018:ffff88085403fdf0  EFLAGS: 00010086
  RAX: 0000000000020000 RBX: 0000000000000010 RCX: 0000000000000000
  RDX: 000060ef80008248 RSI: 0000000000000286 RDI: 6b6b6b6b6b6b6b6b
  RBP: ffff88085403fdf0 R08: 0000000000000286 R09: 0000000000009f39
  R10: 0000000000020001 R11: 0000000000020001 R12: ffff88103c17a130
  R13: ffff88103c17a080 R14: 0000000000000000 R15: 0000000000000000
  FS:  0000000000000000(0000) GS:ffff88107fca0000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 00000000006e5ab8 CR3: 000000000193d000 CR4: 00000000000407e0
  Stack:
   ffff88085403fe18 ffffffff812cbfc2 ffff88103c17a130 0000000000000000
   ffff88103c17a130 ffff88085403fec0 ffffffff810d1d28 ffff880854021de0
   ffff880854021de0 ffff88107fcaec58 ffff88085403fe80 ffff88107fcaec30
  Call Trace:
   [&lt;ffffffff812cbfc2&gt;] __blkg_release_rcu+0x72/0x150
   [&lt;ffffffff810d1d28&gt;] rcu_nocb_kthread+0x1e8/0x300
   [&lt;ffffffff81091d81&gt;] kthread+0xe1/0x100
   [&lt;ffffffff8163813c&gt;] ret_from_fork+0x7c/0xb0
  Code: ff 47 04 48 8b 7d 08 be 00 02 00 00 e8 55 48 a4 ff 5d c3 0f 1f 00 66 66 66 66 90 55 48 89 e5
  +fa 66 66 90 66 66 90 b8 00 00 02 00 &lt;f0&gt; 0f c1 07 89 c2 c1 ea 10 66 39 c2 75 02 5d c3 83 e2 fe 0f
  +b7
  RIP  [&lt;ffffffff8162e9e5&gt;] _raw_spin_lock_irq+0x15/0x60
   RSP &lt;ffff88085403fdf0&gt;

The request_queue locking was added because blkcg_gq-&gt;refcnt is an int
protected with the queue lock and __blkg_release_rcu() needs to put
the parent.  Let's fix it by making blkcg_gq-&gt;refcnt an atomic_t and
dropping queue locking in the function.

Given the general heavy weight of the current request_queue and blkcg
operations, this is unlikely to cause any noticeable overhead.
Moreover, blkcg_gq-&gt;refcnt is likely to be converted to percpu_ref in
the near future, so whatever (most likely negligible) overhead it may
add is temporary.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Joe Lawrence &lt;joe.lawrence@stratus.com&gt;
Acked-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Link: http://lkml.kernel.org/g/alpine.DEB.2.02.1406081816540.17948@jlaw-desktop.mno.stratus.com
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit a5049a8ae34950249a7ae94c385d7c5c98914412 upstream.

Hello,

So, this patch should do.  Joe, Vivek, can one of you guys please
verify that the oops goes away with this patch?

Jens, the original thread can be read at

  http://thread.gmane.org/gmane.linux.kernel/1720729

The fix converts blkg-&gt;refcnt from int to atomic_t.  It does some
overhead but it should be minute compared to everything else which is
going on and the involved cacheline bouncing, so I think it's highly
unlikely to cause any noticeable difference.  Also, the refcnt in
question should be converted to a perpcu_ref for blk-mq anyway, so the
atomic_t is likely to go away pretty soon anyway.

Thanks.

------- 8&lt; -------
__blkg_release_rcu() may be invoked after the associated request_queue
is released with a RCU grace period inbetween.  As such, the function
and callbacks invoked from it must not dereference the associated
request_queue.  This is clearly indicated in the comment above the
function.

Unfortunately, while trying to fix a different issue, 2a4fd070ee85
("blkcg: move bulk of blkcg_gq release operations to the RCU
callback") ignored this and added [un]locking of @blkg-&gt;q-&gt;queue_lock
to __blkg_release_rcu().  This of course can cause oops as the
request_queue may be long gone by the time this code gets executed.

  general protection fault: 0000 [#1] SMP
  CPU: 21 PID: 30 Comm: rcuos/21 Not tainted 3.15.0 #1
  Hardware name: Stratus ftServer 6400/G7LAZ, BIOS BIOS Version 6.3:57 12/25/2013
  task: ffff880854021de0 ti: ffff88085403c000 task.ti: ffff88085403c000
  RIP: 0010:[&lt;ffffffff8162e9e5&gt;]  [&lt;ffffffff8162e9e5&gt;] _raw_spin_lock_irq+0x15/0x60
  RSP: 0018:ffff88085403fdf0  EFLAGS: 00010086
  RAX: 0000000000020000 RBX: 0000000000000010 RCX: 0000000000000000
  RDX: 000060ef80008248 RSI: 0000000000000286 RDI: 6b6b6b6b6b6b6b6b
  RBP: ffff88085403fdf0 R08: 0000000000000286 R09: 0000000000009f39
  R10: 0000000000020001 R11: 0000000000020001 R12: ffff88103c17a130
  R13: ffff88103c17a080 R14: 0000000000000000 R15: 0000000000000000
  FS:  0000000000000000(0000) GS:ffff88107fca0000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 00000000006e5ab8 CR3: 000000000193d000 CR4: 00000000000407e0
  Stack:
   ffff88085403fe18 ffffffff812cbfc2 ffff88103c17a130 0000000000000000
   ffff88103c17a130 ffff88085403fec0 ffffffff810d1d28 ffff880854021de0
   ffff880854021de0 ffff88107fcaec58 ffff88085403fe80 ffff88107fcaec30
  Call Trace:
   [&lt;ffffffff812cbfc2&gt;] __blkg_release_rcu+0x72/0x150
   [&lt;ffffffff810d1d28&gt;] rcu_nocb_kthread+0x1e8/0x300
   [&lt;ffffffff81091d81&gt;] kthread+0xe1/0x100
   [&lt;ffffffff8163813c&gt;] ret_from_fork+0x7c/0xb0
  Code: ff 47 04 48 8b 7d 08 be 00 02 00 00 e8 55 48 a4 ff 5d c3 0f 1f 00 66 66 66 66 90 55 48 89 e5
  +fa 66 66 90 66 66 90 b8 00 00 02 00 &lt;f0&gt; 0f c1 07 89 c2 c1 ea 10 66 39 c2 75 02 5d c3 83 e2 fe 0f
  +b7
  RIP  [&lt;ffffffff8162e9e5&gt;] _raw_spin_lock_irq+0x15/0x60
   RSP &lt;ffff88085403fdf0&gt;

The request_queue locking was added because blkcg_gq-&gt;refcnt is an int
protected with the queue lock and __blkg_release_rcu() needs to put
the parent.  Let's fix it by making blkcg_gq-&gt;refcnt an atomic_t and
dropping queue locking in the function.

Given the general heavy weight of the current request_queue and blkcg
operations, this is unlikely to cause any noticeable overhead.
Moreover, blkcg_gq-&gt;refcnt is likely to be converted to percpu_ref in
the near future, so whatever (most likely negligible) overhead it may
add is temporary.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Joe Lawrence &lt;joe.lawrence@stratus.com&gt;
Acked-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Link: http://lkml.kernel.org/g/alpine.DEB.2.02.1406081816540.17948@jlaw-desktop.mno.stratus.com
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>blktrace: fix accounting of partially completed requests</title>
<updated>2014-05-31T20:20:28+00:00</updated>
<author>
<name>Roman Pen</name>
<email>r.peniaev@gmail.com</email>
</author>
<published>2014-03-04T14:13:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0a8eda9c00ef37e8b40de77f2b0714317191bcf2'/>
<id>0a8eda9c00ef37e8b40de77f2b0714317191bcf2</id>
<content type='text'>
commit af5040da01ef980670b3741b3e10733ee3e33566 upstream.

trace_block_rq_complete does not take into account that request can
be partially completed, so we can get the following incorrect output
of blkparser:

  C   R 232 + 240 [0]
  C   R 240 + 232 [0]
  C   R 248 + 224 [0]
  C   R 256 + 216 [0]

but should be:

  C   R 232 + 8 [0]
  C   R 240 + 8 [0]
  C   R 248 + 8 [0]
  C   R 256 + 8 [0]

Also, the whole output summary statistics of completed requests and
final throughput will be incorrect.

This patch takes into account real completion size of the request and
fixes wrong completion accounting.

Signed-off-by: Roman Pen &lt;r.peniaev@gmail.com&gt;
CC: Steven Rostedt &lt;rostedt@goodmis.org&gt;
CC: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
CC: Ingo Molnar &lt;mingo@redhat.com&gt;
CC: linux-kernel@vger.kernel.org
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit af5040da01ef980670b3741b3e10733ee3e33566 upstream.

trace_block_rq_complete does not take into account that request can
be partially completed, so we can get the following incorrect output
of blkparser:

  C   R 232 + 240 [0]
  C   R 240 + 232 [0]
  C   R 248 + 224 [0]
  C   R 256 + 216 [0]

but should be:

  C   R 232 + 8 [0]
  C   R 240 + 8 [0]
  C   R 248 + 8 [0]
  C   R 256 + 8 [0]

Also, the whole output summary statistics of completed requests and
final throughput will be incorrect.

This patch takes into account real completion size of the request and
fixes wrong completion accounting.

Signed-off-by: Roman Pen &lt;r.peniaev@gmail.com&gt;
CC: Steven Rostedt &lt;rostedt@goodmis.org&gt;
CC: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
CC: Ingo Molnar &lt;mingo@redhat.com&gt;
CC: linux-kernel@vger.kernel.org
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>block: free q-&gt;flush_rq in blk_init_allocated_queue error paths</title>
<updated>2014-03-21T05:32:06+00:00</updated>
<author>
<name>Dave Jones</name>
<email>davej@redhat.com</email>
</author>
<published>2014-03-20T21:03:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=708f04d2abf4e90abee61d9ffb1f165038017ecf'/>
<id>708f04d2abf4e90abee61d9ffb1f165038017ecf</id>
<content type='text'>
Commit 7982e90c3a57 ("block: fix q-&gt;flush_rq NULL pointer crash on
dm-mpath flush") moved an allocation to blk_init_allocated_queue(), but
neglected to free that allocation on the error paths that follow.

Signed-off-by: Dave Jones &lt;davej@fedoraproject.org&gt;
Acked-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 7982e90c3a57 ("block: fix q-&gt;flush_rq NULL pointer crash on
dm-mpath flush") moved an allocation to blk_init_allocated_queue(), but
neglected to free that allocation on the error paths that follow.

Signed-off-by: Dave Jones &lt;davej@fedoraproject.org&gt;
Acked-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>block: change flush sequence list addition back to front add</title>
<updated>2014-03-09T03:31:31+00:00</updated>
<author>
<name>Mike Snitzer</name>
<email>msnitzer@redhat.com</email>
</author>
<published>2014-03-09T03:19:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=10beafc190abcc4ad64024a053441520ba116127'/>
<id>10beafc190abcc4ad64024a053441520ba116127</id>
<content type='text'>
Commit 18741986 inadvertently changed the rq flush insertion
from a head to a tail insertion. Fix that back up.

Signed-off-by: Mike Snitzer &lt;msnitzer@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 18741986 inadvertently changed the rq flush insertion
from a head to a tail insertion. Fix that back up.

Signed-off-by: Mike Snitzer &lt;msnitzer@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>block: fix q-&gt;flush_rq NULL pointer crash on dm-mpath flush</title>
<updated>2014-03-09T00:20:01+00:00</updated>
<author>
<name>Mike Snitzer</name>
<email>snitzer@redhat.com</email>
</author>
<published>2014-03-09T00:20:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=7982e90c3a574c90b51aa1c77404e7e6189d58d5'/>
<id>7982e90c3a574c90b51aa1c77404e7e6189d58d5</id>
<content type='text'>
Commit 1874198 ("blk-mq: rework flush sequencing logic") switched
-&gt;flush_rq from being an embedded member of the request_queue structure
to being dynamically allocated in blk_init_queue_node().

Request-based DM multipath doesn't use blk_init_queue_node(), instead it
uses blk_alloc_queue_node() + blk_init_allocated_queue().  Because
commit 1874198 placed the dynamic allocation of -&gt;flush_rq in
blk_init_queue_node() any flush issued to a dm-mpath device would crash
with a NULL pointer, e.g.:

BUG: unable to handle kernel NULL pointer dereference at           (null)
IP: [&lt;ffffffff8125037e&gt;] blk_rq_init+0x1e/0xb0
PGD bb3c7067 PUD bb01d067 PMD 0
Oops: 0002 [#1] SMP
...
CPU: 5 PID: 5028 Comm: dt Tainted: G        W  O 3.14.0-rc3.snitm+ #10
...
task: ffff88032fb270e0 ti: ffff880079564000 task.ti: ffff880079564000
RIP: 0010:[&lt;ffffffff8125037e&gt;]  [&lt;ffffffff8125037e&gt;] blk_rq_init+0x1e/0xb0
RSP: 0018:ffff880079565c98  EFLAGS: 00010046
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000030
RDX: ffff880260c74048 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffff880079565ca8 R08: ffff880260aa1e98 R09: 0000000000000001
R10: ffff88032fa78500 R11: 0000000000000246 R12: 0000000000000000
R13: ffff880260aa1de8 R14: 0000000000000650 R15: 0000000000000000
FS:  00007f8d36a2a700(0000) GS:ffff88033fca0000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000079b36000 CR4: 00000000000007e0
Stack:
 0000000000000000 ffff880260c74048 ffff880079565cd8 ffffffff81257a47
 ffff880260aa1de8 ffff880260c74048 0000000000000001 0000000000000000
 ffff880079565d08 ffffffff81257c2d 0000000000000000 ffff880260aa1de8
Call Trace:
 [&lt;ffffffff81257a47&gt;] blk_flush_complete_seq+0x2d7/0x2e0
 [&lt;ffffffff81257c2d&gt;] blk_insert_flush+0x1dd/0x210
 [&lt;ffffffff8124ec59&gt;] __elv_add_request+0x1f9/0x320
 [&lt;ffffffff81250681&gt;] ? blk_account_io_start+0x111/0x190
 [&lt;ffffffff81253a4b&gt;] blk_queue_bio+0x25b/0x330
 [&lt;ffffffffa0020bf5&gt;] dm_request+0x35/0x40 [dm_mod]
 [&lt;ffffffff812530c0&gt;] generic_make_request+0xc0/0x100
 [&lt;ffffffff81253173&gt;] submit_bio+0x73/0x140
 [&lt;ffffffff811becdd&gt;] submit_bio_wait+0x5d/0x80
 [&lt;ffffffff81257528&gt;] blkdev_issue_flush+0x78/0xa0
 [&lt;ffffffff811c1f6f&gt;] blkdev_fsync+0x3f/0x60
 [&lt;ffffffff811b7fde&gt;] vfs_fsync_range+0x1e/0x20
 [&lt;ffffffff811b7ffc&gt;] vfs_fsync+0x1c/0x20
 [&lt;ffffffff811b81f1&gt;] do_fsync+0x41/0x80
 [&lt;ffffffff8118874e&gt;] ? SyS_lseek+0x7e/0x80
 [&lt;ffffffff811b8260&gt;] SyS_fsync+0x10/0x20
 [&lt;ffffffff8154c2d2&gt;] system_call_fastpath+0x16/0x1b

Fix this by moving the -&gt;flush_rq allocation from blk_init_queue_node()
to blk_init_allocated_queue().  blk_init_queue_node() also calls
blk_init_allocated_queue() so this change is functionality equivalent
for all blk_init_queue_node() callers.

Reported-by: Hannes Reinecke &lt;hare@suse.de&gt;
Reported-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 1874198 ("blk-mq: rework flush sequencing logic") switched
-&gt;flush_rq from being an embedded member of the request_queue structure
to being dynamically allocated in blk_init_queue_node().

Request-based DM multipath doesn't use blk_init_queue_node(), instead it
uses blk_alloc_queue_node() + blk_init_allocated_queue().  Because
commit 1874198 placed the dynamic allocation of -&gt;flush_rq in
blk_init_queue_node() any flush issued to a dm-mpath device would crash
with a NULL pointer, e.g.:

BUG: unable to handle kernel NULL pointer dereference at           (null)
IP: [&lt;ffffffff8125037e&gt;] blk_rq_init+0x1e/0xb0
PGD bb3c7067 PUD bb01d067 PMD 0
Oops: 0002 [#1] SMP
...
CPU: 5 PID: 5028 Comm: dt Tainted: G        W  O 3.14.0-rc3.snitm+ #10
...
task: ffff88032fb270e0 ti: ffff880079564000 task.ti: ffff880079564000
RIP: 0010:[&lt;ffffffff8125037e&gt;]  [&lt;ffffffff8125037e&gt;] blk_rq_init+0x1e/0xb0
RSP: 0018:ffff880079565c98  EFLAGS: 00010046
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000030
RDX: ffff880260c74048 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffff880079565ca8 R08: ffff880260aa1e98 R09: 0000000000000001
R10: ffff88032fa78500 R11: 0000000000000246 R12: 0000000000000000
R13: ffff880260aa1de8 R14: 0000000000000650 R15: 0000000000000000
FS:  00007f8d36a2a700(0000) GS:ffff88033fca0000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000079b36000 CR4: 00000000000007e0
Stack:
 0000000000000000 ffff880260c74048 ffff880079565cd8 ffffffff81257a47
 ffff880260aa1de8 ffff880260c74048 0000000000000001 0000000000000000
 ffff880079565d08 ffffffff81257c2d 0000000000000000 ffff880260aa1de8
Call Trace:
 [&lt;ffffffff81257a47&gt;] blk_flush_complete_seq+0x2d7/0x2e0
 [&lt;ffffffff81257c2d&gt;] blk_insert_flush+0x1dd/0x210
 [&lt;ffffffff8124ec59&gt;] __elv_add_request+0x1f9/0x320
 [&lt;ffffffff81250681&gt;] ? blk_account_io_start+0x111/0x190
 [&lt;ffffffff81253a4b&gt;] blk_queue_bio+0x25b/0x330
 [&lt;ffffffffa0020bf5&gt;] dm_request+0x35/0x40 [dm_mod]
 [&lt;ffffffff812530c0&gt;] generic_make_request+0xc0/0x100
 [&lt;ffffffff81253173&gt;] submit_bio+0x73/0x140
 [&lt;ffffffff811becdd&gt;] submit_bio_wait+0x5d/0x80
 [&lt;ffffffff81257528&gt;] blkdev_issue_flush+0x78/0xa0
 [&lt;ffffffff811c1f6f&gt;] blkdev_fsync+0x3f/0x60
 [&lt;ffffffff811b7fde&gt;] vfs_fsync_range+0x1e/0x20
 [&lt;ffffffff811b7ffc&gt;] vfs_fsync+0x1c/0x20
 [&lt;ffffffff811b81f1&gt;] do_fsync+0x41/0x80
 [&lt;ffffffff8118874e&gt;] ? SyS_lseek+0x7e/0x80
 [&lt;ffffffff811b8260&gt;] SyS_fsync+0x10/0x20
 [&lt;ffffffff8154c2d2&gt;] system_call_fastpath+0x16/0x1b

Fix this by moving the -&gt;flush_rq allocation from blk_init_queue_node()
to blk_init_allocated_queue().  blk_init_queue_node() also calls
blk_init_allocated_queue() so this change is functionality equivalent
for all blk_init_queue_node() callers.

Reported-by: Hannes Reinecke &lt;hare@suse.de&gt;
Reported-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Signed-off-by: Mike Snitzer &lt;snitzer@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>blk-mq: add REQ_SYNC early</title>
<updated>2014-03-07T15:15:28+00:00</updated>
<author>
<name>Shaohua Li</name>
<email>shli@kernel.org</email>
</author>
<published>2014-02-19T12:20:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=739c3eea711a255df5ed1246face0a4dce5e589f'/>
<id>739c3eea711a255df5ed1246face0a4dce5e589f</id>
<content type='text'>
Add REQ_SYNC early, so rq_dispatched[] in blk_mq_rq_ctx_init
is set correctly.

Signed-off-by: Shaohua Li&lt;shli@fusionio.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add REQ_SYNC early, so rq_dispatched[] in blk_mq_rq_ctx_init
is set correctly.

Signed-off-by: Shaohua Li&lt;shli@fusionio.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>rt,blk,mq: Make blk_mq_cpu_notify_lock a raw spinlock</title>
<updated>2014-03-03T16:34:10+00:00</updated>
<author>
<name>Mike Galbraith</name>
<email>bitbucket@online.de</email>
</author>
<published>2014-03-03T04:57:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2a26ebef841bac72a4c5776e920496e07b405628'/>
<id>2a26ebef841bac72a4c5776e920496e07b405628</id>
<content type='text'>
[  365.164040] BUG: sleeping function called from invalid context at kernel/rtmutex.c:674
[  365.164041] in_atomic(): 1, irqs_disabled(): 1, pid: 26, name: migration/1
[  365.164043] no locks held by migration/1/26.
[  365.164044] irq event stamp: 6648
[  365.164056] hardirqs last  enabled at (6647): [&lt;ffffffff8153d377&gt;] restore_args+0x0/0x30
[  365.164062] hardirqs last disabled at (6648): [&lt;ffffffff810ed98d&gt;] multi_cpu_stop+0x9d/0x120
[  365.164070] softirqs last  enabled at (0): [&lt;ffffffff810543bc&gt;] copy_process.part.28+0x6fc/0x1920
[  365.164072] softirqs last disabled at (0): [&lt;          (null)&gt;]           (null)
[  365.164076] CPU: 1 PID: 26 Comm: migration/1 Tainted: GF           N  3.12.12-rt19-0.gcb6c4a2-rt #3
[  365.164078] Hardware name: QCI QSSC-S4R/QSSC-S4R, BIOS QSSC-S4R.QCI.01.00.S013.032920111005 03/29/2011
[  365.164091]  0000000000000001 ffff880a42ea7c30 ffffffff815367e6 ffffffff81a086c0
[  365.164099]  ffff880a42ea7c40 ffffffff8108919c ffff880a42ea7c60 ffffffff8153c24f
[  365.164107]  ffff880a42ea91f0 00000000ffffffe1 ffff880a42ea7c88 ffffffff81297ec0
[  365.164108] Call Trace:
[  365.164119]  [&lt;ffffffff810060b1&gt;] try_stack_unwind+0x191/0x1a0
[  365.164127]  [&lt;ffffffff81004872&gt;] dump_trace+0x92/0x360
[  365.164133]  [&lt;ffffffff81006108&gt;] show_trace_log_lvl+0x48/0x60
[  365.164138]  [&lt;ffffffff81004c18&gt;] show_stack_log_lvl+0xd8/0x1d0
[  365.164143]  [&lt;ffffffff81006160&gt;] show_stack+0x20/0x50
[  365.164153]  [&lt;ffffffff815367e6&gt;] dump_stack+0x54/0x9a
[  365.164163]  [&lt;ffffffff8108919c&gt;] __might_sleep+0xfc/0x140
[  365.164173]  [&lt;ffffffff8153c24f&gt;] rt_spin_lock+0x1f/0x70
[  365.164182]  [&lt;ffffffff81297ec0&gt;] blk_mq_main_cpu_notify+0x20/0x70
[  365.164191]  [&lt;ffffffff81540a1c&gt;] notifier_call_chain+0x4c/0x70
[  365.164201]  [&lt;ffffffff81083499&gt;] __raw_notifier_call_chain+0x9/0x10
[  365.164207]  [&lt;ffffffff810567be&gt;] cpu_notify+0x1e/0x40
[  365.164217]  [&lt;ffffffff81525da2&gt;] take_cpu_down+0x22/0x40
[  365.164223]  [&lt;ffffffff810ed9c6&gt;] multi_cpu_stop+0xd6/0x120
[  365.164229]  [&lt;ffffffff810edd97&gt;] cpu_stopper_thread+0xd7/0x1e0
[  365.164235]  [&lt;ffffffff810863a3&gt;] smpboot_thread_fn+0x203/0x380
[  365.164241]  [&lt;ffffffff8107cbf8&gt;] kthread+0xc8/0xd0
[  365.164250]  [&lt;ffffffff8154440c&gt;] ret_from_fork+0x7c/0xb0
[  365.164429] smpboot: CPU 1 is now offline

Signed-off-by: Mike Galbraith &lt;bitbucket@online.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[  365.164040] BUG: sleeping function called from invalid context at kernel/rtmutex.c:674
[  365.164041] in_atomic(): 1, irqs_disabled(): 1, pid: 26, name: migration/1
[  365.164043] no locks held by migration/1/26.
[  365.164044] irq event stamp: 6648
[  365.164056] hardirqs last  enabled at (6647): [&lt;ffffffff8153d377&gt;] restore_args+0x0/0x30
[  365.164062] hardirqs last disabled at (6648): [&lt;ffffffff810ed98d&gt;] multi_cpu_stop+0x9d/0x120
[  365.164070] softirqs last  enabled at (0): [&lt;ffffffff810543bc&gt;] copy_process.part.28+0x6fc/0x1920
[  365.164072] softirqs last disabled at (0): [&lt;          (null)&gt;]           (null)
[  365.164076] CPU: 1 PID: 26 Comm: migration/1 Tainted: GF           N  3.12.12-rt19-0.gcb6c4a2-rt #3
[  365.164078] Hardware name: QCI QSSC-S4R/QSSC-S4R, BIOS QSSC-S4R.QCI.01.00.S013.032920111005 03/29/2011
[  365.164091]  0000000000000001 ffff880a42ea7c30 ffffffff815367e6 ffffffff81a086c0
[  365.164099]  ffff880a42ea7c40 ffffffff8108919c ffff880a42ea7c60 ffffffff8153c24f
[  365.164107]  ffff880a42ea91f0 00000000ffffffe1 ffff880a42ea7c88 ffffffff81297ec0
[  365.164108] Call Trace:
[  365.164119]  [&lt;ffffffff810060b1&gt;] try_stack_unwind+0x191/0x1a0
[  365.164127]  [&lt;ffffffff81004872&gt;] dump_trace+0x92/0x360
[  365.164133]  [&lt;ffffffff81006108&gt;] show_trace_log_lvl+0x48/0x60
[  365.164138]  [&lt;ffffffff81004c18&gt;] show_stack_log_lvl+0xd8/0x1d0
[  365.164143]  [&lt;ffffffff81006160&gt;] show_stack+0x20/0x50
[  365.164153]  [&lt;ffffffff815367e6&gt;] dump_stack+0x54/0x9a
[  365.164163]  [&lt;ffffffff8108919c&gt;] __might_sleep+0xfc/0x140
[  365.164173]  [&lt;ffffffff8153c24f&gt;] rt_spin_lock+0x1f/0x70
[  365.164182]  [&lt;ffffffff81297ec0&gt;] blk_mq_main_cpu_notify+0x20/0x70
[  365.164191]  [&lt;ffffffff81540a1c&gt;] notifier_call_chain+0x4c/0x70
[  365.164201]  [&lt;ffffffff81083499&gt;] __raw_notifier_call_chain+0x9/0x10
[  365.164207]  [&lt;ffffffff810567be&gt;] cpu_notify+0x1e/0x40
[  365.164217]  [&lt;ffffffff81525da2&gt;] take_cpu_down+0x22/0x40
[  365.164223]  [&lt;ffffffff810ed9c6&gt;] multi_cpu_stop+0xd6/0x120
[  365.164229]  [&lt;ffffffff810edd97&gt;] cpu_stopper_thread+0xd7/0x1e0
[  365.164235]  [&lt;ffffffff810863a3&gt;] smpboot_thread_fn+0x203/0x380
[  365.164241]  [&lt;ffffffff8107cbf8&gt;] kthread+0xc8/0xd0
[  365.164250]  [&lt;ffffffff8154440c&gt;] ret_from_fork+0x7c/0xb0
[  365.164429] smpboot: CPU 1 is now offline

Signed-off-by: Mike Galbraith &lt;bitbucket@online.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>blk-mq: support partial I/O completions</title>
<updated>2014-02-21T16:58:49+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@infradead.org</email>
</author>
<published>2014-02-20T23:32:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d6a25b31315327eef7785b895c354cc45c3f3742'/>
<id>d6a25b31315327eef7785b895c354cc45c3f3742</id>
<content type='text'>
Add a new blk_mq_end_io_partial function to partially complete requests
as needed by the SCSI layer.  We do this by reusing blk_update_request
to advance the bio instead of having a simplified version of it in
the blk-mq code.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a new blk_mq_end_io_partial function to partially complete requests
as needed by the SCSI layer.  We do this by reusing blk_update_request
to advance the bio instead of having a simplified version of it in
the blk-mq code.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>blk-mq: merge blk_mq_insert_request and blk_mq_run_request</title>
<updated>2014-02-21T16:58:48+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@infradead.org</email>
</author>
<published>2014-02-20T23:32:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=feb71dae1f9e0aeb056f7f639a21e620d327fc66'/>
<id>feb71dae1f9e0aeb056f7f639a21e620d327fc66</id>
<content type='text'>
It's almost identical to blk_mq_insert_request, so fold the two into one
slightly more generic function by making the flush special case a bit
smarted.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It's almost identical to blk_mq_insert_request, so fold the two into one
slightly more generic function by making the flush special case a bit
smarted.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>blk-mq: remove blk_mq_alloc_rq</title>
<updated>2014-02-21T16:58:47+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@infradead.org</email>
</author>
<published>2014-02-20T23:32:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=fd694131bb033e7b1fd748498cd9a70e9c16420b'/>
<id>fd694131bb033e7b1fd748498cd9a70e9c16420b</id>
<content type='text'>
There's only one caller, which is a straight wrapper and fits the naming
scheme of the related functions a lot better.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There's only one caller, which is a straight wrapper and fits the naming
scheme of the related functions a lot better.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
