--- linux-2.6.3-mm4.orig/fs/direct-io.c 2004-03-04 14:44:13.635931855 -0800 +++ linux-2.6.3-mm4/fs/direct-io.c 2004-03-04 15:11:27.860131715 -0800 @@ -1076,8 +1076,12 @@ direct_io_worker(int rw, struct kiocb *i } dio_complete(dio, offset, ret); /* We could have also come here on an AIO file extend */ - if (!is_sync_kiocb(iocb) && !(rw == WRITE && ret >= 0 && - dio->result < dio->size)) + if (!is_sync_kiocb(iocb) && rw == WRITE && + ret >= 0 && dio->result == dio->size) + /* + * For AIO writes where we have completed the + * i/o, we have to mark the the aio complete. + */ aio_complete(iocb, ret, 0); kfree(dio); }