[<prev] [next>] [day] [month] [year] [list]
Message-ID: <516FA134.6000203@cn.fujitsu.com>
Date: Thu, 18 Apr 2013 15:31:00 +0800
From: Gu Zheng <guz.fnst@...fujitsu.com>
To: Al Viro <viro@...iv.linux.org.uk>
CC: linux-fsdevel <linux-fsdevel@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
majianpeng <majianpeng@...il.com>
Subject: [PATCH]fs/block_dev.c: fix the inaccurate judgement in function blkdev_aio_read
In function blkdev_aio_read(), the judgement of 'size', if it is equal or greater than
the target count we request(iocb->ki_left), 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@...il.com>
Signed-off-by: Gu Zheng <guz.fnst@...fujitsu.com>
---
fs/block_dev.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/block_dev.c b/fs/block_dev.c
index aae187a..f0328f1 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1559,7 +1559,7 @@ static ssize_t blkdev_aio_read(struct kiocb *iocb, const struct iovec *iov,
return 0;
size -= pos;
- if (size < INT_MAX)
+ if (size < iocb->ki_left)
nr_segs = iov_shorten((struct iovec *)iov, nr_segs, size);
return generic_file_aio_read(iocb, iov, nr_segs, pos);
}
--
1.7.7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists