lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Sun, 19 Oct 2008 18:03:01 +0400 From: Dmitri Monakhov <dmonakhov@...nvz.org> To: linux-kernel@...r.kernel.org Cc: linux-fsdevel@...r.kernel.org, Dmitri Monakhov <dmonakhov@...nvz.org> Subject: [PATCH 2/2] ocfs2: truncate outstanding block after direct io failure. Signed-off-by: Dmitri Monakhov <dmonakhov@...nvz.org> --- fs/ocfs2/file.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 8d3225a..0b68b30 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -1867,6 +1867,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; } -- 1.5.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists