Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] revert blockdev direct io back to 2.6.19 version

Andrew Vasquez is reporting as-iosched oopses and a 65% throughput
slowdown due to the recent special-casing of direct-io against
blockdevs. We don't know why either of these things are occurring.

The patch minimally reverts us back to the 2.6.19 code for a 2.6.20
release.

Cc: Andrew Vasquez <andrew.vasquez@qlogic.com>
Cc: Ken Chen <kenchen@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Andrew Morton and committed by
Linus Torvalds
b2e895db 8560a10e

+41
+41
fs/block_dev.c
··· 129 129 return 0; 130 130 } 131 131 132 + static int 133 + blkdev_get_blocks(struct inode *inode, sector_t iblock, 134 + struct buffer_head *bh, int create) 135 + { 136 + sector_t end_block = max_block(I_BDEV(inode)); 137 + unsigned long max_blocks = bh->b_size >> inode->i_blkbits; 138 + 139 + if ((iblock + max_blocks) > end_block) { 140 + max_blocks = end_block - iblock; 141 + if ((long)max_blocks <= 0) { 142 + if (create) 143 + return -EIO; /* write fully beyond EOF */ 144 + /* 145 + * It is a read which is fully beyond EOF. We return 146 + * a !buffer_mapped buffer 147 + */ 148 + max_blocks = 0; 149 + } 150 + } 151 + 152 + bh->b_bdev = I_BDEV(inode); 153 + bh->b_blocknr = iblock; 154 + bh->b_size = max_blocks << inode->i_blkbits; 155 + if (max_blocks) 156 + set_buffer_mapped(bh); 157 + return 0; 158 + } 159 + 160 + static ssize_t 161 + blkdev_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, 162 + loff_t offset, unsigned long nr_segs) 163 + { 164 + struct file *file = iocb->ki_filp; 165 + struct inode *inode = file->f_mapping->host; 166 + 167 + return blockdev_direct_IO_no_locking(rw, iocb, inode, I_BDEV(inode), 168 + iov, offset, nr_segs, blkdev_get_blocks, NULL); 169 + } 170 + 171 + #if 0 132 172 static int blk_end_aio(struct bio *bio, unsigned int bytes_done, int error) 133 173 { 134 174 struct kiocb *iocb = bio->bi_private; ··· 363 323 return PTR_ERR(page); 364 324 goto completion; 365 325 } 326 + #endif 366 327 367 328 static int blkdev_writepage(struct page *page, struct writeback_control *wbc) 368 329 {