summaryrefslogtreecommitdiff
path: root/fs/compat.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2015-11-30 20:15:42 +0300
committerJens Axboe <axboe@fb.com>2015-11-30 20:15:42 +0300
commit74cedf9b6c603f2278a05bc91b140b32b434d0b5 (patch)
tree0d4412cee169295a290867b72545b65c742527a8 /fs/compat.c
parentbf4e6b4e757488dee1b6a581f49c7ac34cd217f8 (diff)
downloadlinux-74cedf9b6c603f2278a05bc91b140b32b434d0b5.tar.xz
direct-io: Fix negative return from dio read beyond eof
Assume a filesystem with 4KB blocks. When a file has size 1000 bytes and we issue direct IO read at offset 1024, blockdev_direct_IO() reads the tail of the last block and the logic for handling short DIO reads in dio_complete() results in a return value -24 (1000 - 1024) which obviously confuses userspace. Fix the problem by bailing out early once we sample i_size and can reliably check that direct IO read starts beyond i_size. Reported-by: Avi Kivity <avi@scylladb.com> Fixes: 9fe55eea7e4b444bafc42fa0000cc2d1d2847275 CC: stable@vger.kernel.org CC: Steven Whitehouse <swhiteho@redhat.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'fs/compat.c')
0 files changed, 0 insertions, 0 deletions