]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
directio: account for extra page IOs for unaligned request
authorDave Kleikamp <dave.kleikamp@oracle.com>
Thu, 12 Apr 2012 21:44:41 +0000 (16:44 -0500)
committerDave Kleikamp <dave.kleikamp@oracle.com>
Thu, 12 Apr 2012 21:48:50 +0000 (16:48 -0500)
sdio_init() initializes pages_in_io to 2 for an unaligned directio request
in order that a zero page may be written to the first and last block.
However, __blockdev_direct_IO_bvec was setting pages_in_io to the number
of pages in the request rather than adding them to the original value.

Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
fs/direct-io.c

index 65ff39f39519f3cbcf0f590bd3cda0453a5c12f3..3c138051e58564d09958c0675a0a82ebdeff0cc3 100644 (file)
@@ -1400,7 +1400,7 @@ __blockdev_direct_IO_bvec(int rw, struct kiocb *iocb, struct inode *inode,
 
        sdio_init(&sdio, inode, offset, blkbits, get_block, submit_io);
 
-       sdio.pages_in_io = bvec_len;
+       sdio.pages_in_io += bvec_len;
 
        for (i = 0; i < bvec_len; i++) {
                sdio.size += bvec[i].bv_len;