[PATCH] blkdev_get_blocks(): handle eof
For reasons which escape me, blockdev_get_blocks() is returning -EIO if the mapping request straddles the end of the disk. This causes reads which straddle end-of-disk to return -EIO. Fix it up so that it correctly trims the returned result down to match the size of the device, for both reads and writes. If a write attempt is fully beyond end-of-device then return -EIO. We never get this far anyway, because generic_write_checks() will return -ENOSPC if all of the write lies outside a blockdev's i_size. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing
Please register or sign in to comment