• Andrew Morton's avatar
    [PATCH] blkdev_get_blocks(): handle eof · 877bc275
    Andrew Morton authored
    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: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    877bc275
block_dev.c 21.6 KB