<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/stable/linux.git/drivers/block/floppy.c, branch linux-3.6.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<id>https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/atom?h=linux-3.6.y</id>
<link rel='self' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/atom?h=linux-3.6.y'/>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/'/>
<updated>2012-12-17T17:26:53+00:00</updated>
<entry>
<title>floppy: destroy floppy workqueue before cleaning up the queue</title>
<updated>2012-12-17T17:26:53+00:00</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2012-11-06T10:47:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=20cd349c86c42696dd743526f1a87a774305dce3'/>
<id>urn:sha1:20cd349c86c42696dd743526f1a87a774305dce3</id>
<content type='text'>
commit eac7cc52c6b410e542af431b2ee93f3d7dbfb6af upstream.

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;
Signed-off-by: Herton Ronaldo Krzesinski &lt;herton.krzesinski@canonical.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>floppy: properly handle failure on add_disk loop</title>
<updated>2012-11-05T08:56:49+00:00</updated>
<author>
<name>Herton Ronaldo Krzesinski</name>
<email>herton.krzesinski@canonical.com</email>
</author>
<published>2012-08-27T23:56:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6d59ab3707595e1a7b2e6051ff3f5f0dabd0ad06'/>
<id>urn:sha1:6d59ab3707595e1a7b2e6051ff3f5f0dabd0ad06</id>
<content type='text'>
commit d60e7ec18c3fb2cbf90969ccd42889eb2d03aef9 upstream.

On floppy initialization, if something failed inside the loop we call
add_disk, there was no cleanup of previous iterations in the error
handling.

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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>floppy: do put_disk on current dr if blk_init_queue fails</title>
<updated>2012-11-05T08:56:49+00:00</updated>
<author>
<name>Herton Ronaldo Krzesinski</name>
<email>herton.krzesinski@canonical.com</email>
</author>
<published>2012-08-27T23:56:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d4eaaf6e3cf75c8394a36b6de67a1771da5ed2ee'/>
<id>urn:sha1:d4eaaf6e3cf75c8394a36b6de67a1771da5ed2ee</id>
<content type='text'>
commit 238ab78469c6ab7845b43d5061cd3c92331b2452 upstream.

If blk_init_queue fails, we do not call put_disk on the current dr
(dr is decremented first in the error handling loop).

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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>floppy: don't call alloc_ordered_workqueue inside the alloc_disk loop</title>
<updated>2012-11-05T08:56:49+00:00</updated>
<author>
<name>Herton Ronaldo Krzesinski</name>
<email>herton.krzesinski@canonical.com</email>
</author>
<published>2012-08-27T23:56:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0de4380ecfc63f6f3940b9ec03c36c78f008ac12'/>
<id>urn:sha1:0de4380ecfc63f6f3940b9ec03c36c78f008ac12</id>
<content type='text'>
commit b54e1f88897bcacc2cd359f48ea3b39eaf55f084 upstream.

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.

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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&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:36+00:00</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@kernel.dk</email>
</author>
<published>2012-07-31T09:47:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/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:39+00:00</updated>
<author>
<name>Fengguang Wu</name>
<email>fengguang.wu@intel.com</email>
</author>
<published>2012-07-28T11:45:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/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>
<entry>
<title>Merge branch 'for-jens' of git://git.drbd.org/linux-drbd into for-3.6/drivers</title>
<updated>2012-07-30T07:03:10+00:00</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@kernel.dk</email>
</author>
<published>2012-07-30T07:03:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=72ea1f74fcdf874cca6d2c0962379523bbd99e2c'/>
<id>urn:sha1:72ea1f74fcdf874cca6d2c0962379523bbd99e2c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>floppy: Run floppy initialization asynchronous</title>
<updated>2012-07-04T12:01:40+00:00</updated>
<author>
<name>Andi Kleen</name>
<email>ak@linux.intel.com</email>
</author>
<published>2012-07-03T00:27:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0cc15d03bcccdf95e2bd82e094e6064e61b54207'/>
<id>urn:sha1:0cc15d03bcccdf95e2bd82e094e6064e61b54207</id>
<content type='text'>
floppy_init is quite slow, 3s on my test system to determine
that there is no floppy. Run it asynchronous to the other
init calls to improve boot time.

[jkosina@suse.cz: fix modular build]

Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>floppy: cancel any pending fd_timeouts before adding a new one</title>
<updated>2012-07-03T22:51:22+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-07-03T22:51:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=dab058fd5ff834cb3b9de1d930ce731a605eb0c6'/>
<id>urn:sha1:dab058fd5ff834cb3b9de1d930ce731a605eb0c6</id>
<content type='text'>
In commit 070ad7e793dc ("floppy: convert to delayed work and
single-thread wq") the 'fd_timeout' timer was converted to a delayed
work.  However, the "del_timer(&amp;fd_timeout)" was lost in the process,
and any previous pending timeouts would stay active when we then
re-queued the timeout.

This resulted in the floppy probe sequence having a (stale) 20s timeout
rather than the intended 3s timeout, and thus made booting with the
floppy driver (but no actual floppy controller) take much longer than it
should.

Of course, there's little reason for most people to compile the floppy
driver into the kernel at all, which is why most people never noticed.

Canceling the delayed work where we used to do the del_timer() fixes the
issue, and makes the floppy probing use the proper new timeout instead.
The three second timeout is still very wasteful, but better than the 20s
one.

Reported-and-tested-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Reported-and-tested-by: Calvin Walton &lt;calvin.walton@kepstin.ca&gt;
Cc: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>floppy: remove floppy-specific O_EXCL handling</title>
<updated>2012-05-18T13:19:11+00:00</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2012-05-18T11:50:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bfa10b8c98bb335bc3e401d3ec947d446f04d1aa'/>
<id>urn:sha1:bfa10b8c98bb335bc3e401d3ec947d446f04d1aa</id>
<content type='text'>
Block layer now handles O_EXCL in a generic way for block devices.

The semantics is however different for floppy and all other block devices,
as floppy driver contains its own O_EXCL handling.

The semantics for all-but-floppy bdevs is "there can be at most one O_EXCL
open of this file", while for floppy bdev the semantics is "if someone has
the bdev open with O_EXCL, noone else can open it".

There is actual userspace-observable change in behavior because of this
since commit e525fd89d380c ("block: make blkdev_get/put() handle exclusive
access") -- on kernels containing this commit, mount of /dev/fd0 causes
the fd0 block device be claimed with _EXCL, preventing subsequent
open(/dev/fd0).

Bring things back into shape, i.e.  make it possible, analogically to
other block devices, to mount the floppy and open() it afterwards --
remove the floppy-specific handling and let the generic bdev code O_EXCL
handling take over.

Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
</feed>
