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);
}
}
} /* 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.
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;
}