]> Pileus Git - ~andy/linux/commitdiff
ocfs2: Initialize count in aio_write before generic_write_checks
authorGoldwyn Rodrigues <rgoldwyn@gmail.com>
Sat, 11 Jul 2009 15:57:27 +0000 (10:57 -0500)
committerJoel Becker <joel.becker@oracle.com>
Mon, 20 Jul 2009 22:47:58 +0000 (15:47 -0700)
generic_write_checks() expects count to be initialized to the size of
the write.  Writes to files open with O_DIRECT|O_LARGEFILE write 0 bytes
because count is uninitialized.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.de>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
fs/ocfs2/file.c

index a49fa44aea1f33c982bcd3dd7203ed702fb66652..aa501d3f93f1bcec3af38a24361ab61cda2cc052 100644 (file)
@@ -1851,6 +1851,7 @@ relock:
                if (ret)
                        goto out_dio;
 
+               count = ocount;
                ret = generic_write_checks(file, ppos, &count,
                                           S_ISBLK(inode->i_mode));
                if (ret)