The patch titled ocfs2: truncate outstanding block after direct io failure has been added to the -mm tree. Its filename is ocfs2-truncate-outstanding-block-after-direct-io-failure.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: ocfs2: truncate outstanding block after direct io failure From: Dmitri Monakhov <dmonakhov@xxxxxxxxxx> Signed-off-by: Dmitri Monakhov <dmonakhov@xxxxxxxxxx> Cc: Jeff Moyer <jmoyer@xxxxxxxxxx> Cc: Mark Fasheh <mark.fasheh@xxxxxxxxxx> Cc: Joel Becker <Joel.Becker@xxxxxxxxxx> Cc: Nick Piggin <nickpiggin@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/ocfs2/file.c | 7 +++++++ 1 file changed, 7 insertions(+) diff -puN fs/ocfs2/file.c~ocfs2-truncate-outstanding-block-after-direct-io-failure fs/ocfs2/file.c --- a/fs/ocfs2/file.c~ocfs2-truncate-outstanding-block-after-direct-io-failure +++ a/fs/ocfs2/file.c @@ -1866,6 +1866,13 @@ relock: written = generic_file_direct_write(iocb, iov, &nr_segs, *ppos, ppos, count, ocount); if (written < 0) { + /* + * direct write may have instantiated a few + * blocks outside i_size. Trim these off again. + * Don't need i_size_read because we hold i_mutex. + */ + if (*ppos + count > inode->i_size) + vmtruncate(inode, inode->i_size); ret = written; goto out_dio; } _ Patches currently in -mm which might be from dmonakhov@xxxxxxxxxx are ocfs2-truncate-outstanding-block-after-direct-io-failure.patch kill-suid-bit-only-for-regular-files.patch fs-truncate-blocks-outside-i_size-after-generic_file_direct_write-error.patch fs-truncate-blocks-outside-i_size-after-generic_file_direct_write-error-fix.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