X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fdirect-io.c;h=37f593c42e56654cf5e6b31d9dc9d1079d17f81a;hb=9bf4aaab3e101692164d49b7ca357651eb691cb6;hp=d498521c97b78d7ec8985060da63ad17462ccc29;hpb=db216c3d5e4c040e557a50f8f5d35d5c415e8c1c;p=linux-2.6.git diff --git a/fs/direct-io.c b/fs/direct-io.c index d498521c9..37f593c42 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -395,7 +395,7 @@ static int dio_bio_complete(struct dio *dio, struct bio *bio) for (page_no = 0; page_no < bio->bi_vcnt; page_no++) { struct page *page = bvec[page_no].bv_page; - if (dio->rw == READ) + if (dio->rw == READ && !PageCompound(page)) set_page_dirty_lock(page); page_cache_release(page); } @@ -990,6 +990,13 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode, } } /* end iovec loop */ + if (ret == -ENOTBLK && rw == WRITE) { + /* + * The remaining part of the request will be + * be handled by buffered I/O when we return + */ + ret = 0; + } /* * There may be some unwritten disk at the end of a part-written * fs-block-sized block. Go zero that now. @@ -1089,13 +1096,6 @@ direct_io_worker(int rw, struct kiocb *iocb, struct inode *inode, aio_complete(iocb, ret, 0); kfree(dio); } - if (ret == -ENOTBLK && rw == WRITE) { - /* - * The entire request will be be handled by buffered I/O - * when we return - */ - ret = 0; - } return ret; }