--- linux-2.6.0-test10/fs/direct-io.c 2003-11-25 12:45:14.000000000 -0800 +++ linux-2.6.0-test10.new/fs/direct-io.c 2003-11-25 15:20:26.554239616 -0800 @@ -946,6 +946,12 @@ direct_io_worker(int rw, struct kiocb *i if (dio->bio) dio_bio_submit(dio); + /* + * It is possible that, we return short IO due to end of file. + * In that case, we need to release all the pages we got hold on. + */ + dio_cleanup(dio); + /* * OK, all BIOs are submitted, so we can decrement bio_count to truly * reflect the number of to-be-processed BIOs.