From: Al Viro Date: Mon, 10 Mar 2014 06:30:55 +0000 (-0400) Subject: dio: take updating ->result into do_direct_IO() X-Git-Tag: v4.14-rc1~7392^2~55 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3320c60b3a26d05666285c55ab08ee043c017ba3;p=platform%2Fkernel%2Flinux-rpi.git dio: take updating ->result into do_direct_IO() Signed-off-by: Al Viro --- diff --git a/fs/direct-io.c b/fs/direct-io.c index adfa1fb..387d919 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -1003,6 +1003,7 @@ do_holes: 1 << blkbits); sdio->block_in_file++; block_in_page++; + dio->result += 1 << blkbits; goto next_block; } @@ -1044,6 +1045,7 @@ do_holes: sdio->block_in_file += this_chunk_blocks; block_in_page += this_chunk_blocks; sdio->blocks_available -= this_chunk_blocks; + dio->result += this_chunk_blocks << blkbits; next_block: BUG_ON(sdio->block_in_file > sdio->final_block_in_request); if (sdio->block_in_file == sdio->final_block_in_request) @@ -1271,10 +1273,6 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, retval = do_direct_IO(dio, &sdio, &map_bh); - dio->result += iter->iov[seg].iov_len - - ((sdio.final_block_in_request - sdio.block_in_file) << - blkbits); - if (retval) { dio_cleanup(dio, &sdio); break;