]> git.baikalelectronics.ru Git - kernel.git/commit
Return short read or 0 at end of a raw device, not EIO
authorDavid Jeffery <djeffery@redhat.com>
Mon, 29 Sep 2014 14:21:10 +0000 (10:21 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 31 Oct 2014 10:33:26 +0000 (06:33 -0400)
commit91fac6ceaa953b2e7583bf5b802d49e6073231c8
tree4a46a47864031b2a019d6fa605d835a3ca88c539
parentf04ea043d2250780122849c055ae01e78933f911
Return short read or 0 at end of a raw device, not EIO

Author: David Jeffery <djeffery@redhat.com>
Changes to the basic direct I/O code have broken the raw driver when reading
to the end of a raw device.  Instead of returning a short read for a read that
extends partially beyond the device's end or 0 when at the end of the device,
these reads now return EIO.

The raw driver needs the same end of device handling as was added for normal
block devices.  Using blkdev_read_iter, which has the needed size checks,
prevents the EIO conditions at the end of the device.

Signed-off-by: David Jeffery <djeffery@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/char/raw.c
fs/block_dev.c
include/linux/fs.h