<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/block/floppy.c, branch v3.8</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=v3.8</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.8'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2012-11-23T13:32:54Z</updated>
<entry>
<title>floppy: destroy floppy workqueue before cleaning up the queue</title>
<updated>2012-11-23T13:32:54Z</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2012-11-06T10:47:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eac7cc52c6b410e542af431b2ee93f3d7dbfb6af'/>
<id>urn:sha1:eac7cc52c6b410e542af431b2ee93f3d7dbfb6af</id>
<content type='text'>
We need to first destroy the floppy_wq workqueue before cleaning up
the queue. Otherwise we might race with still pending work with the
workqueue, but all the block queue already gone. This might lead to
various oopses, such as

 CPU 0
 Pid: 6, comm: kworker/u:0 Not tainted 3.7.0-rc4 #1 Bochs Bochs
 RIP: 0010:[&lt;ffffffff8134eef5&gt;]  [&lt;ffffffff8134eef5&gt;] blk_peek_request+0xd5/0x1c0
 RSP: 0000:ffff88000dc7dd88  EFLAGS: 00010092
 RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000000
 RDX: ffff88000f602688 RSI: ffffffff81fd95d8 RDI: 6b6b6b6b6b6b6b6b
 RBP: ffff88000dc7dd98 R08: ffffffff81fd95c8 R09: 0000000000000000
 R10: ffffffff81fd9480 R11: 0000000000000001 R12: 6b6b6b6b6b6b6b6b
 R13: ffff88000dc7dfd8 R14: ffff88000dc7dfd8 R15: 0000000000000000
 FS:  0000000000000000(0000) GS:ffffffff81e21000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
 CR2: 0000000000000000 CR3: 0000000001e11000 CR4: 00000000000006f0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
 Process kworker/u:0 (pid: 6, threadinfo ffff88000dc7c000, task ffff88000dc5ecc0)
 Stack:
  0000000000000000 0000000000000000 ffff88000dc7ddb8 ffffffff8134efee
  ffff88000dc7ddb8 0000000000000000 ffff88000dc7dde8 ffffffff814aef3c
  ffffffff81e75d80 ffff88000dc0c640 ffff88000fbfb000 ffffffff814aed90
 Call Trace:
  [&lt;ffffffff8134efee&gt;] blk_fetch_request+0xe/0x30
  [&lt;ffffffff814aef3c&gt;] redo_fd_request+0x1ac/0x400
  [&lt;ffffffff814aed90&gt;] ? start_motor+0x130/0x130
  [&lt;ffffffff8106b526&gt;] process_one_work+0x136/0x450
  [&lt;ffffffff8106af65&gt;] ? manage_workers+0x205/0x2e0
  [&lt;ffffffff8106bb6d&gt;] worker_thread+0x14d/0x420
  [&lt;ffffffff8106ba20&gt;] ? rescuer_thread+0x1a0/0x1a0
  [&lt;ffffffff8107075a&gt;] kthread+0xba/0xc0
  [&lt;ffffffff810706a0&gt;] ? __kthread_parkme+0x80/0x80
  [&lt;ffffffff818b553a&gt;] ret_from_fork+0x7a/0xb0
  [&lt;ffffffff810706a0&gt;] ? __kthread_parkme+0x80/0x80
 Code: 0f 84 c0 00 00 00 83 f8 01 0f 85 e2 00 00 00 81 4b 40 00 00 80 00 48 89 df e8 58 f8 ff ff be fb ff ff ff
 fe ff ff &lt;49&gt; 8b 1c 24 49 39 dc 0f 85 2e ff ff ff 41 0f b6 84 24 28 04 00
 RIP  [&lt;ffffffff8134eef5&gt;] blk_peek_request+0xd5/0x1c0
  RSP &lt;ffff88000dc7dd88&gt;

Reported-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Tested-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>floppy: remove dr, reuse drive on do_floppy_init</title>
<updated>2012-10-30T07:36:07Z</updated>
<author>
<name>Herton Ronaldo Krzesinski</name>
<email>herton.krzesinski@canonical.com</email>
</author>
<published>2012-10-30T07:36:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1a4ae43e4feb570901667782678772fd31c1b125'/>
<id>urn:sha1:1a4ae43e4feb570901667782678772fd31c1b125</id>
<content type='text'>
This is a small cleanup, that also may turn error handling of
unitialized disks more readable. We don't need a separate variable to
track allocated disks, remove dr and reuse drive variable instead.

Signed-off-by: Herton Ronaldo Krzesinski &lt;herton.krzesinski@canonical.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>floppy: use common function to check if floppies can be registered</title>
<updated>2012-10-30T07:34:25Z</updated>
<author>
<name>Herton Ronaldo Krzesinski</name>
<email>herton.krzesinski@canonical.com</email>
</author>
<published>2012-08-27T23:56:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8d3ab4ebfd7435bc248873de47d0ca23076c4973'/>
<id>urn:sha1:8d3ab4ebfd7435bc248873de47d0ca23076c4973</id>
<content type='text'>
The same checks to see if a drive can be or is registered are
repeated through the code, factor out the checks in a common function
and replace the repeated checks with it.

Signed-off-by: Herton Ronaldo Krzesinski &lt;herton.krzesinski@canonical.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>floppy: properly handle failure on add_disk loop</title>
<updated>2012-10-30T07:34:25Z</updated>
<author>
<name>Herton Ronaldo Krzesinski</name>
<email>herton.krzesinski@canonical.com</email>
</author>
<published>2012-08-27T23:56:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d60e7ec18c3fb2cbf90969ccd42889eb2d03aef9'/>
<id>urn:sha1:d60e7ec18c3fb2cbf90969ccd42889eb2d03aef9</id>
<content type='text'>
On floppy initialization, if something failed inside the loop we call
add_disk, there was no cleanup of previous iterations in the error
handling.

Cc: stable@vger.kernel.org
Signed-off-by: Herton Ronaldo Krzesinski &lt;herton.krzesinski@canonical.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>floppy: do put_disk on current dr if blk_init_queue fails</title>
<updated>2012-10-30T07:34:25Z</updated>
<author>
<name>Herton Ronaldo Krzesinski</name>
<email>herton.krzesinski@canonical.com</email>
</author>
<published>2012-08-27T23:56:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=238ab78469c6ab7845b43d5061cd3c92331b2452'/>
<id>urn:sha1:238ab78469c6ab7845b43d5061cd3c92331b2452</id>
<content type='text'>
If blk_init_queue fails, we do not call put_disk on the current dr
(dr is decremented first in the error handling loop).

Cc: stable@vger.kernel.org
Reviewed-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Herton Ronaldo Krzesinski &lt;herton.krzesinski@canonical.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>floppy: don't call alloc_ordered_workqueue inside the alloc_disk loop</title>
<updated>2012-10-30T07:34:24Z</updated>
<author>
<name>Herton Ronaldo Krzesinski</name>
<email>herton.krzesinski@canonical.com</email>
</author>
<published>2012-08-27T23:56:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b54e1f88897bcacc2cd359f48ea3b39eaf55f084'/>
<id>urn:sha1:b54e1f88897bcacc2cd359f48ea3b39eaf55f084</id>
<content type='text'>
Since commit 070ad7e ("floppy: convert to delayed work and single-thread
wq"), we end up calling alloc_ordered_workqueue multiple times inside
the loop, which shouldn't be intended. Besides the leak, other side
effect in the current code is if blk_init_queue fails, we would end up
calling unregister_blkdev even if we didn't call yet register_blkdev.

Just moved the allocation of floppy_wq before the loop, and adjusted the
code accordingly.

Cc: stable@vger.kernel.org # 3.5+
Acked-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Reviewed-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Herton Ronaldo Krzesinski &lt;herton.krzesinski@canonical.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>workqueue: deprecate __cancel_delayed_work()</title>
<updated>2012-08-21T20:18:24Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-08-21T20:18:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=136b5721d75a62a8f02c601c89122e32c1a85a84'/>
<id>urn:sha1:136b5721d75a62a8f02c601c89122e32c1a85a84</id>
<content type='text'>
Now that cancel_delayed_work() can be safely called from IRQ handlers,
there's no reason to use __cancel_delayed_work().  Use
cancel_delayed_work() instead of __cancel_delayed_work() and mark the
latter deprecated.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Jiri Kosina &lt;jkosina@suse.cz&gt;
Cc: Roland Dreier &lt;roland@kernel.org&gt;
Cc: Tomi Valkeinen &lt;tomi.valkeinen@ti.com&gt;
</content>
</entry>
<entry>
<title>workqueue: use mod_delayed_work() instead of __cancel + queue</title>
<updated>2012-08-21T20:18:24Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-08-21T20:18:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e7c2f967445dd2041f0f8e3179cca22bb8bb7f79'/>
<id>urn:sha1:e7c2f967445dd2041f0f8e3179cca22bb8bb7f79</id>
<content type='text'>
Now that mod_delayed_work() is safe to call from IRQ handlers,
__cancel_delayed_work() followed by queue_delayed_work() can be
replaced with mod_delayed_work().

Most conversions are straight-forward except for the following.

* net/core/link_watch.c: linkwatch_schedule_work() was doing a quite
  elaborate dancing around its delayed_work.  Collapse it such that
  linkwatch_work is queued for immediate execution if LW_URGENT and
  existing timer is kept otherwise.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Tomi Valkeinen &lt;tomi.valkeinen@ti.com&gt; 
</content>
</entry>
<entry>
<title>Merge branch 'upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/floppy into for-3.6/drivers</title>
<updated>2012-07-31T09:47:36Z</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@kernel.dk</email>
</author>
<published>2012-07-31T09:47:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=10af8138eb6d09d6a768e43ef1aa9b2f16b8c7be'/>
<id>urn:sha1:10af8138eb6d09d6a768e43ef1aa9b2f16b8c7be</id>
<content type='text'>
</content>
</entry>
<entry>
<title>floppy: remove duplicated flag FD_RAW_NEED_DISK</title>
<updated>2012-07-31T09:38:39Z</updated>
<author>
<name>Fengguang Wu</name>
<email>fengguang.wu@intel.com</email>
</author>
<published>2012-07-28T11:45:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2fb2ca6f5b953192d5a94fcc778d9abba06462df'/>
<id>urn:sha1:2fb2ca6f5b953192d5a94fcc778d9abba06462df</id>
<content type='text'>
Fix coccinelle warning (without behavior change):

drivers/block/floppy.c:2518:32-48: duplicated argument to &amp; or |

Signed-off-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
</feed>
