Messages in this thread Patch in this message | | | Subject | [PATCH 2.6.7-rc3-mm2] handle partial DIO write | From | Daniel McNeil <> | Date | 15 Jun 2004 11:19:26 -0700 |
| |
Andrew,
The fsx-linux hole fill failure problem was caused by generic_file_aio_write_nolock() not handling the partial DIO write correctly. Here's a patch lets DIO do the partial write, and the fallback to buffered is done (correctly) for what is left. This fixes the hole filling without retrying the entire i/o. This patch also applies to 2.6.7-rc3 with some offset.
I tested this (on ext3) with fsx-linux -l 500000 -r 4096 -t 4096 -w 4096 -Z -N 10000 junk -R -W
Daniel
diff -rup linux-2.6.7-rc3-mm2.orig/fs/direct-io.c linux-2.6.7-rc3-mm2/fs/direct-io.c --- linux-2.6.7-rc3-mm2.orig/fs/direct-io.c 2004-06-15 10:38:54.588122820 -0700 +++ linux-2.6.7-rc3-mm2/fs/direct-io.c 2004-06-15 10:43:45.803731414 -0700 @@ -990,6 +990,13 @@ direct_io_worker(int rw, struct kiocb *i } } /* 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 *i 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; } diff -rup linux-2.6.7-rc3-mm2.orig/mm/filemap.c linux-2.6.7-rc3-mm2/mm/filemap.c --- linux-2.6.7-rc3-mm2.orig/mm/filemap.c 2004-06-15 10:39:05.361146577 -0700 +++ linux-2.6.7-rc3-mm2/mm/filemap.c 2004-06-15 10:43:45.806730864 -0700 @@ -1915,7 +1915,7 @@ generic_file_aio_write_nolock(struct kio count -= written; } - buf = iov->iov_base; + buf = iov->iov_base + written; /* handle partial DIO write */ do { unsigned long index; unsigned long offset;
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |