The patch titled direct-io-sync-and-invalidate-file-region-when-falling-back-to-buffered-write fix fix has been added to the -mm tree. Its filename is direct-io-sync-and-invalidate-file-region-when-falling-back-to-buffered-write-fix-fix.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: direct-io-sync-and-invalidate-file-region-when-falling-back-to-buffered-write fix fix From: Jeff Moyer <jmoyer@xxxxxxxxxx> Cc: Jeff Moyer <jmoyer@xxxxxxxxxx> Cc: Zach Brown <zach.brown@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- mm/filemap.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletion(-) diff -puN mm/filemap.c~direct-io-sync-and-invalidate-file-region-when-falling-back-to-buffered-write-fix-fix mm/filemap.c --- a/mm/filemap.c~direct-io-sync-and-invalidate-file-region-when-falling-back-to-buffered-write-fix-fix +++ a/mm/filemap.c @@ -2291,8 +2291,17 @@ __generic_file_aio_write_nolock(struct k written_buffered = generic_file_buffered_write(iocb, iov, nr_segs, pos, ppos, count, written); - if (written_buffered < 0 || written_buffered == written) + /* + * If generic_file_buffered_write() retuned a synchronous error + * then we want to return the number of bytes which were + * direct-written, or the error code if that was zero. Note + * that this differs from normal direct-io semantics, which + * will return -EFOO even if some bytes were written. + */ + if (written_buffered < 0) { + err = written_buffered; goto out; + } /* * We need to ensure that the page cache pages are written to _ Patches currently in -mm which might be from jmoyer@xxxxxxxxxx are direct-io-sync-and-invalidate-file-region-when-falling-back-to-buffered-write.patch direct-io-sync-and-invalidate-file-region-when-falling-back-to-buffered-write-fix.patch direct-io-sync-and-invalidate-file-region-when-falling-back-to-buffered-write-fix-fix.patch dio-centralize-completion-in-dio_complete.patch dio-call-blk_run_address_space-once-per-op.patch dio-formalize-bio-counters-as-a-dio-reference-count.patch dio-remove-duplicate-bio-wait-code.patch dio-only-call-aio_complete-after-returning-eiocbqueued.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html