aboutsummaryrefslogtreecommitdiffstats
path: root/fs/block_dev.c
diff options
context:
space:
mode:
authorGu Zheng <guz.fnst@cn.fujitsu.com>2013-04-29 14:55:52 -0400
committerJens Axboe <axboe@kernel.dk>2013-04-29 15:24:30 -0400
commit6f8f5c260af67fed49fe14efc3ad1f69654c260e (patch)
tree7394a785edeeb5caec8bf065f5e02b44c9878d4e /fs/block_dev.c
parent871dd9286e25330c8a581e5dacfa8b1dfe1dd641 (diff)
fs/block_dev.c: fix iov_shorten() criteria in blkdev_aio_read()
blkdev_aio_read() test 'size' to see if it is equal or greater than the target count we request(iocb->ki_left). If so there is no need to call iov_shorten() to reduce number of segments and the iovec's length. So the judgement should be changed to 'if (size < iocb->ki_left)' instead. Signed-off-by: Jianpeng Ma <majianpeng@gmail.com> Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Jens Axboe <axboe@kernel.dk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r--fs/block_dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index aea605c98ba6..dc7f9836fb5e 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1558,7 +1558,7 @@ static ssize_t blkdev_aio_read(struct kiocb *iocb, const struct iovec *iov,
1558 return 0; 1558 return 0;
1559 1559
1560 size -= pos; 1560 size -= pos;
1561 if (size < INT_MAX) 1561 if (size < iocb->ki_left)
1562 nr_segs = iov_shorten((struct iovec *)iov, nr_segs, size); 1562 nr_segs = iov_shorten((struct iovec *)iov, nr_segs, size);
1563 return generic_file_aio_read(iocb, iov, nr_segs, pos); 1563 return generic_file_aio_read(iocb, iov, nr_segs, pos);
1564} 1564}