All of lore.kernel.org
 help / color / mirror / Atom feed
* + fs-block_devc-fix-iov_shorten-criteria-in-blkdev_aio_read.patch added to -mm tree
@ 2013-04-22 21:09 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2013-04-22 21:09 UTC (permalink / raw)
  To: mm-commits; +Cc: guz.fnst, axboe, majianpeng, viro


The patch titled
     Subject: fs/block_dev.c: fix iov_shorten() criteria in blkdev_aio_read()
has been added to the -mm tree.  Its filename is
     fs-block_devc-fix-iov_shorten-criteria-in-blkdev_aio_read.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Gu Zheng <guz.fnst@cn.fujitsu.com>
Subject: 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>
---

 fs/block_dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN fs/block_dev.c~fs-block_devc-fix-iov_shorten-criteria-in-blkdev_aio_read fs/block_dev.c
--- a/fs/block_dev.c~fs-block_devc-fix-iov_shorten-criteria-in-blkdev_aio_read
+++ a/fs/block_dev.c
@@ -1559,7 +1559,7 @@ static ssize_t blkdev_aio_read(struct ki
 		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);
 }
_

Patches currently in -mm which might be from guz.fnst@cn.fujitsu.com are

fs-block_devc-fix-iov_shorten-criteria-in-blkdev_aio_read.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-04-22 21:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-22 21:09 + fs-block_devc-fix-iov_shorten-criteria-in-blkdev_aio_read.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.