<feed xmlns='http://www.w3.org/2005/Atom'>
<title>snowball/igloo-kernel.git/block, branch u0</title>
<subtitle>Igloo kernel</subtitle>
<id>https://git.etezian.org/cgit.cgi/snowball/igloo-kernel.git/atom?h=u0</id>
<link rel='self' href='https://git.etezian.org/cgit.cgi/snowball/igloo-kernel.git/atom?h=u0'/>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/snowball/igloo-kernel.git/'/>
<updated>2011-03-11T14:36:08+00:00</updated>
<entry>
<title>block: fix mis-synchronisation in blkdev_issue_zeroout()</title>
<updated>2011-03-11T14:36:08+00:00</updated>
<author>
<name>Lukas Czerner</name>
<email>lczerner@redhat.com</email>
</author>
<published>2011-03-11T09:23:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/snowball/igloo-kernel.git/commit/?id=0aeea18964173715a1037034ef6838198f319319'/>
<id>urn:sha1:0aeea18964173715a1037034ef6838198f319319</id>
<content type='text'>
BZ29402
https://bugzilla.kernel.org/show_bug.cgi?id=29402

We can hit serious mis-synchronization in bio completion path of
blkdev_issue_zeroout() leading to a panic.

The problem is that when we are going to wait_for_completion() in
blkdev_issue_zeroout() we check if the bb.done equals issued (number of
submitted bios). If it does, we can skip the wait_for_completition()
and just out of the function since there is nothing to wait for.
However, there is a ordering problem because bio_batch_end_io() is
calling atomic_inc(&amp;bb-&gt;done) before complete(), hence it might seem to
blkdev_issue_zeroout() that all bios has been completed and exit. At
this point when bio_batch_end_io() is going to call complete(bb-&gt;wait),
bb and wait does not longer exist since it was allocated on stack in
blkdev_issue_zeroout() ==&gt; panic!

(thread 1)                      (thread 2)
bio_batch_end_io()              blkdev_issue_zeroout()
  if(bb) {                      ...
    if (bb-&gt;end_io)             ...
      bb-&gt;end_io(bio, err);     ...
    atomic_inc(&amp;bb-&gt;done);      ...
    ...                         while (issued != atomic_read(&amp;bb.done))
    ...                         (let issued == bb.done)
    ...                         (do the rest of the function)
    ...                         return ret;
    complete(bb-&gt;wait);
    ^^^^^^^^
    panic

We can fix this easily by simplifying bio_batch and completion counting.

Also remove bio_end_io_t *end_io since it is not used.

Signed-off-by: Lukas Czerner &lt;lczerner@redhat.com&gt;
Reported-by: Eric Whitney &lt;eric.whitney@hp.com&gt;
Tested-by: Eric Whitney &lt;eric.whitney@hp.com&gt;
Reviewed-by: Jeff Moyer &lt;jmoyer@redhat.com&gt;
CC: Dmitry Monakhov &lt;dmonakhov@openvz.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>block: blk-flush shouldn't call directly into q-&gt;request_fn() __blk_run_queue()</title>
<updated>2011-03-02T13:48:06+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2011-03-02T13:48:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/snowball/igloo-kernel.git/commit/?id=255bb490c8c27eed484d538efe6ef6a7473bd3f6'/>
<id>urn:sha1:255bb490c8c27eed484d538efe6ef6a7473bd3f6</id>
<content type='text'>
blk-flush decomposes a flush into sequence of multiple requests.  On
completion of a request, the next one is queued; however, block layer
must not implicitly call into q-&gt;request_fn() directly from completion
path.  This makes the queue behave unexpectedly when seen from the
drivers and violates the assumption that q-&gt;request_fn() is called
with process context + queue_lock.

This patch makes blk-flush the following two changes to make sure
q-&gt;request_fn() is not called directly from request completion path.

- blk_flush_complete_seq_end_io() now asks __blk_run_queue() to always
  use kblockd instead of calling directly into q-&gt;request_fn().

- queue_next_fseq() uses ELEVATOR_INSERT_REQUEUE instead of
  ELEVATOR_INSERT_FRONT so that elv_insert() doesn't try to unplug the
  request queue directly.

Reported by Jan in the following threads.

 http://thread.gmane.org/gmane.linux.ide/48778
 http://thread.gmane.org/gmane.linux.ide/48786

stable: applicable to v2.6.37.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Jan Beulich &lt;JBeulich@novell.com&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: stable@kernel.org
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>block: add @force_kblockd to __blk_run_queue()</title>
<updated>2011-03-02T13:48:05+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2011-03-02T13:48:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/snowball/igloo-kernel.git/commit/?id=1654e7411a1ad4999fe7890ef51d2a2bbb1fcf76'/>
<id>urn:sha1:1654e7411a1ad4999fe7890ef51d2a2bbb1fcf76</id>
<content type='text'>
__blk_run_queue() automatically either calls q-&gt;request_fn() directly
or schedules kblockd depending on whether the function is recursed.
blk-flush implementation needs to be able to explicitly choose
kblockd.  Add @force_kblockd.

All the current users are converted to specify %false for the
parameter and this patch doesn't introduce any behavior change.

stable: This is prerequisite for fixing ide oops caused by the new
        blk-flush implementation.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Jan Beulich &lt;JBeulich@novell.com&gt;
Cc: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Cc: stable@kernel.org
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>block: fix kernel-doc format for blkdev_issue_zeroout</title>
<updated>2011-03-01T18:45:24+00:00</updated>
<author>
<name>Ben Hutchings</name>
<email>ben@decadent.org.uk</email>
</author>
<published>2011-03-01T18:45:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/snowball/igloo-kernel.git/commit/?id=291d24f6d9e7bbef81454fade8a44720665c7302'/>
<id>urn:sha1:291d24f6d9e7bbef81454fade8a44720665c7302</id>
<content type='text'>
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>blk-throttle: Do not use kblockd workqueue for throtl work</title>
<updated>2011-03-01T18:41:53+00:00</updated>
<author>
<name>Vivek Goyal</name>
<email>vgoyal@redhat.com</email>
</author>
<published>2011-03-01T18:40:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/snowball/igloo-kernel.git/commit/?id=450adcbe518ab3a3953d8475309525d22de77cba'/>
<id>urn:sha1:450adcbe518ab3a3953d8475309525d22de77cba</id>
<content type='text'>
o Dominik Klein reported a system hang issue while doing some blkio
  throttling testing.

  https://lkml.org/lkml/2011/2/24/173

o Some tracing revealed that CFQ was not dispatching any more jobs as
  queue unplug was not happening. And queue unplug was not happening
  because unplug work was not being called as there was one throttling
  work on same cpu which as not finished yet. And throttling work had not
  finished as it was tyring to dispatch a bio to CFQ but all the request
  descriptors were consume to it was put to sleep.

o So basically it is a cyclic dependecny between CFQ unplug work and
  throtl dispatch work. Tejun suggested that use separate workqueue for
  such cases.

o This patch uses a separate workqueue for throttle related work and
  does not rely on kblockd workqueue anymore.

Cc: stable@kernel.org
Reported-by: Dominik Klein &lt;dk@in-telegence.net&gt;
Signed-off-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://neil.brown.name/md</title>
<updated>2011-02-25T19:13:26+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-02-25T19:13:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/snowball/igloo-kernel.git/commit/?id=638691a7a46a4ae9a7b56c603299e42d7f6e722e'/>
<id>urn:sha1:638691a7a46a4ae9a7b56c603299e42d7f6e722e</id>
<content type='text'>
* 'for-linus' of git://neil.brown.name/md:
  md: Fix - again - partition detection when array becomes active
  Fix over-zealous flush_disk when changing device size.
  md: avoid spinlock problem in blk_throtl_exit
  md: correctly handle probe of an 'mdp' device.
  md: don't set_capacity before array is active.
  md: Fix raid1-&gt;raid0 takeover
</content>
</entry>
<entry>
<title>block: fix refcounting in BLKBSZSET</title>
<updated>2011-02-24T16:54:21+00:00</updated>
<author>
<name>Miklos Szeredi</name>
<email>mszeredi@suse.cz</email>
</author>
<published>2011-02-24T14:45:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/snowball/igloo-kernel.git/commit/?id=3c522cedb572bb8d2e4867f358bdaa7d0c53d88c'/>
<id>urn:sha1:3c522cedb572bb8d2e4867f358bdaa7d0c53d88c</id>
<content type='text'>
Adam Kovari and others reported that disconnecting an USB drive with
an ntfs-3g filesystem would cause "kernel BUG at fs/inode.c:1421!" to
be triggered.

The BUG could be traced back to ioctl(BLKBSZSET), which would
erroneously decrement the refcount on the bdev.  This is because
blkdev_get() expects the refcount to be already incremented and either
returns success or decrements the refcount and returns an error.

The bug was introduced by e525fd89 (block: make blkdev_get/put()
handle exclusive access), which didn't take into account this behavior
of blkdev_get().

This fixes
  https://bugzilla.kernel.org/show_bug.cgi?id=29202
(and likely 29792 too)

Reported-by: Adam Kovari &lt;kovariadam@gmail.com&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Miklos Szeredi &lt;mszeredi@suse.cz&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Fix over-zealous flush_disk when changing device size.</title>
<updated>2011-02-24T06:25:47+00:00</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2011-02-24T06:25:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/snowball/igloo-kernel.git/commit/?id=93b270f76e7ef3b81001576860c2701931cdc78b'/>
<id>urn:sha1:93b270f76e7ef3b81001576860c2701931cdc78b</id>
<content type='text'>
There are two cases when we call flush_disk.
In one, the device has disappeared (check_disk_change) so any
data will hold becomes irrelevant.
In the oter, the device has changed size (check_disk_size_change)
so data we hold may be irrelevant.

In both cases it makes sense to discard any 'clean' buffers,
so they will be read back from the device if needed.

In the former case it makes sense to discard 'dirty' buffers
as there will never be anywhere safe to write the data.  In the
second case it *does*not* make sense to discard dirty buffers
as that will lead to file system corruption when you simply enlarge
the containing devices.

flush_disk calls __invalidate_devices.
__invalidate_device calls both invalidate_inodes and invalidate_bdev.

invalidate_inodes *does* discard I_DIRTY inodes and this does lead
to fs corruption.

invalidate_bev *does*not* discard dirty pages, but I don't really care
about that at present.

So this patch adds a flag to __invalidate_device (calling it
__invalidate_device2) to indicate whether dirty buffers should be
killed, and this is passed to invalidate_inodes which can choose to
skip dirty inodes.

flusk_disk then passes true from check_disk_change and false from
check_disk_size_change.

dm avoids tripping over this problem by calling i_size_write directly
rathher than using check_disk_size_change.

md does use check_disk_size_change and so is affected.

This regression was introduced by commit 608aeef17a which causes
check_disk_size_change to call flush_disk, so it is suitable for any
kernel since 2.6.27.

Cc: stable@kernel.org
Acked-by: Jeff Moyer &lt;jmoyer@redhat.com&gt;
Cc: Andrew Patterson &lt;andrew.patterson@hp.com&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block</title>
<updated>2011-02-09T19:45:21+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-02-09T19:45:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/snowball/igloo-kernel.git/commit/?id=aceb91cd351bc3a19a783c901fe8a8070d5f6fa9'/>
<id>urn:sha1:aceb91cd351bc3a19a783c901fe8a8070d5f6fa9</id>
<content type='text'>
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  cdrom: support devices that have check_events but not media_changed
  cfq-iosched: Don't wait if queue already has requests.
  blkio-throttle: Avoid calling blkiocg_lookup_group() for root group
  cfq: rename a function to give it more appropriate name
  cciss: make cciss_revalidate not loop through CISS_MAX_LUNS volumes unnecessarily.
  drivers/block/aoe/Makefile: replace the use of &lt;module&gt;-objs with &lt;module&gt;-y
  loop: queue_lock NULL pointer derefence in blk_throtl_exit
  drivers/block/Makefile: replace the use of &lt;module&gt;-objs with &lt;module&gt;-y
  blktrace: Don't output messages if NOTIFY isn't set.
</content>
</entry>
<entry>
<title>cfq-iosched: Don't wait if queue already has requests.</title>
<updated>2011-02-09T13:22:36+00:00</updated>
<author>
<name>Justin TerAvest</name>
<email>teravest@google.com</email>
</author>
<published>2011-02-09T13:20:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.etezian.org/cgit.cgi/snowball/igloo-kernel.git/commit/?id=02a8f01b5a9f396d0327977af4c232d0f94c45fd'/>
<id>urn:sha1:02a8f01b5a9f396d0327977af4c232d0f94c45fd</id>
<content type='text'>
Commit 7667aa0630407bc07dc38dcc79d29cc0a65553c1 added logic to wait for
the last queue of the group to become busy (have at least one request),
so that the group does not lose out for not being continuously
backlogged. The commit did not check for the condition that the last
queue already has some requests. As a result, if the queue already has
requests, wait_busy is set. Later on, cfq_select_queue() checks the
flag, and decides that since the queue has a request now and wait_busy
is set, the queue is expired.  This results in early expiration of the
queue.

This patch fixes the problem by adding a check to see if queue already
has requests. If it does, wait_busy is not set. As a result, time slices
do not expire early.

The queues with more than one request are usually buffered writers.
Testing shows improvement in isolation between buffered writers.

Cc: stable@kernel.org
Signed-off-by: Justin TerAvest &lt;teravest@google.com&gt;
Reviewed-by: Gui Jianfeng &lt;guijianfeng@cn.fujitsu.com&gt;
Acked-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
</feed>
