2.6.10-rc1-mm2 DIO failures
Hi Andrew,
I see LTP DIO test failures on 2.6.10-rc1-mm2 while doing direct-IO write to filesystem files.
This is due to the changes in generic_file_direct_IO(). I haven't
looked at what exactly happening here (whats faling with page shoot down). But we end up getting -EIO.
/*
- * Called under i_sem for writes to S_ISREG files
+ * Called under i_sem for writes to S_ISREG files. Returns -EIO if something
+ * went wrong during pagecache shootdown.
*/
ssize_t
generic_file_direct_IO(int rw, struct kiocb *iocb, const struct iovec
*iov,
@@ -2539,14 +2540,24 @@ generic_file_direct_IO(int rw, struct ki
struct address_space *mapping = file->f_mapping;
ssize_t retval;+ /*
+ * If it's a write, unmap all mmappings of the file up-front. This + * will cause any pte dirty bits to be propagated into the pageframes + * for the subsequent filemap_write_and_wait(). + */
+ if (rw == WRITE && mapping_mapped(mapping))
+ unmap_mapping_range(mapping, 0, -1, 0);
...
Thanks,
Badari
# ./diotest2 diotest02 1 PASS : Read with Direct IO, Write without write failed:Input/output error [2] Write Direct failed diotest02 2 FAIL : Write with Direct IO, Read without diotest02 3 PASS : Read, Write with Direct IO diotest2 1/3 testblocks failed
Quoted 3 lines · Badari Pulavarty
I see LTP DIO test failures on 2.6.10-rc1-mm2 while doing direct-IO write to filesystem files.
Fixed in -mm5. See ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.10-rc1/2.6.10-rc1-mm5/broken-out/readpage-vs-invalidate-fix.patch
Quoted 10 lines · Andrew Morton
Quoted 2 lines · Badari Pulavarty
I see LTP DIO test failures on 2.6.10-rc1-mm2 while doing direct-IO write to filesystem files.
Fixed in -mm5. See ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.10-rc1/2.6.10-rc1-mm5/broken-out/readpage-vs-invalidate-fix.patch
Verified and work fine now.
Thanks,
Badari