<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/block/floppy.c, branch v4.9</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.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-08-25T14:56:51Z</updated>
<entry>
<title>Revert "floppy: refactor open() flags handling"</title>
<updated>2016-08-25T14:56:51Z</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@fb.com</email>
</author>
<published>2016-08-25T14:56:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f2791e7eadf437633f30faa51b30878cf15650be'/>
<id>urn:sha1:f2791e7eadf437633f30faa51b30878cf15650be</id>
<content type='text'>
This reverts commit 09954bad448791ef01202351d437abdd9497a804.
</content>
</entry>
<entry>
<title>Revert "floppy: fix open(O_ACCMODE) for ioctl-only open"</title>
<updated>2016-08-25T14:56:44Z</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@fb.com</email>
</author>
<published>2016-08-25T14:56:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=468c298ad3ed3f0d94a65f8ca00f6bfc6c2b4e33'/>
<id>urn:sha1:468c298ad3ed3f0d94a65f8ca00f6bfc6c2b4e33</id>
<content type='text'>
This reverts commit ff06db1efb2ad6db06eb5b99b88a0c15a9cc9b0e.
</content>
</entry>
<entry>
<title>floppy: fix open(O_ACCMODE) for ioctl-only open</title>
<updated>2016-08-04T20:19:16Z</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2016-06-16T07:53:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ff06db1efb2ad6db06eb5b99b88a0c15a9cc9b0e'/>
<id>urn:sha1:ff06db1efb2ad6db06eb5b99b88a0c15a9cc9b0e</id>
<content type='text'>
Commit 09954bad4 ("floppy: refactor open() flags handling"), as a
side-effect, causes open(/dev/fdX, O_ACCMODE) to fail. It turns out that
this is being used setfdprm userspace for ioctl-only open().

Reintroduce back the original behavior wrt !(FMODE_READ|FMODE_WRITE)
modes, while still keeping the original O_NDELAY bug fixed.

Cc: stable@vger.kernel.org # v4.5+
Reported-by: Wim Osterholt &lt;wim@djo.tudelft.nl&gt;
Tested-by: Wim Osterholt &lt;wim@djo.tudelft.nl&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>block: convert to device_add_disk()</title>
<updated>2016-06-27T19:26:08Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2016-06-16T02:44:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0d52c756a665adc032c791307bc55e392b0186b3'/>
<id>urn:sha1:0d52c756a665adc032c791307bc55e392b0186b3</id>
<content type='text'>
For block drivers that specify a parent device, convert them to use
device_add_disk().

This conversion was done with the following semantic patch:

    @@
    struct gendisk *disk;
    expression E;
    @@

    - disk-&gt;driverfs_dev = E;
    ...
    - add_disk(disk);
    + device_add_disk(E, disk);

    @@
    struct gendisk *disk;
    expression E1, E2;
    @@

    - disk-&gt;driverfs_dev = E1;
    ...
    E2 = disk;
    ...
    - add_disk(E2);
    + device_add_disk(E1, E2);

...plus some manual fixups for a few missed conversions.

Cc: Jens Axboe &lt;axboe@fb.com&gt;
Cc: Keith Busch &lt;keith.busch@intel.com&gt;
Cc: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Cc: David Woodhouse &lt;dwmw2@infradead.org&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: James Bottomley &lt;James.Bottomley@hansenpartnership.com&gt;
Cc: Ross Zwisler &lt;ross.zwisler@linux.intel.com&gt;
Cc: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Cc: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>block, fs, mm, drivers: use bio set/get op accessors</title>
<updated>2016-06-07T19:41:38Z</updated>
<author>
<name>Mike Christie</name>
<email>mchristi@redhat.com</email>
</author>
<published>2016-06-05T19:31:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=95fe6c1a209ef89d9f94dd04a0ad72be1487d5d5'/>
<id>urn:sha1:95fe6c1a209ef89d9f94dd04a0ad72be1487d5d5</id>
<content type='text'>
This patch converts the simple bi_rw use cases in the block,
drivers, mm and fs code to set/get the bio operation using
bio_set_op_attrs/bio_op

These should be simple one or two liner cases, so I just did them
in one patch. The next patches handle the more complicated
cases in a module per patch.

Signed-off-by: Mike Christie &lt;mchristi@redhat.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>block/fs/drivers: remove rw argument from submit_bio</title>
<updated>2016-06-07T19:41:38Z</updated>
<author>
<name>Mike Christie</name>
<email>mchristi@redhat.com</email>
</author>
<published>2016-06-05T19:31:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4e49ea4a3d276365bf7396c9b77b4d1d5923835a'/>
<id>urn:sha1:4e49ea4a3d276365bf7396c9b77b4d1d5923835a</id>
<content type='text'>
This has callers of submit_bio/submit_bio_wait set the bio-&gt;bi_rw
instead of passing it in. This makes that use the same as
generic_make_request and how we set the other bio fields.

Signed-off-by: Mike Christie &lt;mchristi@redhat.com&gt;

Fixed up fs/ext4/crypto.c

Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>floppy: refactor open() flags handling</title>
<updated>2016-02-06T22:00:22Z</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2016-02-06T22:00:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=09954bad448791ef01202351d437abdd9497a804'/>
<id>urn:sha1:09954bad448791ef01202351d437abdd9497a804</id>
<content type='text'>
In case /dev/fdX is open with O_NDELAY / O_NONBLOCK, floppy_open() immediately
succeeds, without performing any further media / controller preparations.
That's "correct" wrt. the NODELAY flag, but is hardly correct wrt. the rest
of the floppy driver, that is not really O_NONBLOCK ready, at all. Therefore
it's not too surprising, that subsequent attempts to work with the
filedescriptor produce bad results. Namely, syzkaller tool has been able
to livelock mmap() on the returned fd to keep waiting on the page unlock
bit forever.

Quite frankly, I have trouble defining what non-blocking behavior would be for
floppies. Is waiting ages for the driver to actually succeed reading a sector
blocking operation? Is waiting for drive motor to start blocking operation? How
about in case of virtualized floppies?

One option would be returning EWOULDBLOCK in case O_NDLEAY / O_NONBLOCK is
being passed to open(). That has a theoretical potential of breaking some
arcane and archaic userspace though.

Let's take a more conservative aproach, and accept the O_NDLEAY flag, and let
the driver behave as usual.

While at it, clean up a bit handling of !(mode &amp; (FMODE_READ|FMODE_WRITE))
case and return EINVAL instead of succeeding as well.

Spotted by syzkaller tool.

Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-4.5/for-jens' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/linux-block into for-linus</title>
<updated>2016-02-01T16:08:39Z</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@fb.com</email>
</author>
<published>2016-02-01T16:08:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=90b90d06db0be30aeb89b6b4ab618d644211a85e'/>
<id>urn:sha1:90b90d06db0be30aeb89b6b4ab618d644211a85e</id>
<content type='text'>
Locking fix from Jiri
</content>
</entry>
<entry>
<title>floppy: fix lock_fdc() signal handling</title>
<updated>2016-02-01T10:19:17Z</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2016-02-01T10:19:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a0c80efe5956ccce9fe7ae5c78542578c07bc20a'/>
<id>urn:sha1:a0c80efe5956ccce9fe7ae5c78542578c07bc20a</id>
<content type='text'>
floppy_revalidate() doesn't perform any error handling on lock_fdc()
result. lock_fdc() might actually be interrupted by a signal (it waits for
fdc becoming non-busy interruptibly). In such case, floppy_revalidate()
proceeds as if it had claimed the lock, but it fact it doesn't.

In case of multiple threads trying to open("/dev/fdX"), this leads to
serious corruptions all over the place, because all of a sudden there is
no critical section protection (that'd otherwise be guaranteed by locked
fd) whatsoever.

While at this, fix the fact that the 'interruptible' parameter to
lock_fdc() doesn't make any sense whatsoever, because we always wait
interruptibly anyway.

Most of the lock_fdc() callsites do properly handle error (and propagate
EINTR), but floppy_revalidate() and floppy_check_events() don't. Fix this.

Spotted by 'syzkaller' tool.

Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>floppy: make local variable non-static</title>
<updated>2015-12-08T14:15:32Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2015-12-01T14:54:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bcf4299e6215a475259c3ac329d43e776cfe9c0c'/>
<id>urn:sha1:bcf4299e6215a475259c3ac329d43e776cfe9c0c</id>
<content type='text'>
There's no reason for temparea to be static, since it's only used for
temporary sprintf output. It's not immediately obvious that the output
will always fit (in the worst case, the output including '\0' is
exactly 32 bytes), so save a future reader from worrying about that.

Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
</feed>
