提交 cefcb800 编写于 作者: G Goldwyn Rodrigues 提交者: Joel Becker

ocfs2: Initialize count in aio_write before generic_write_checks

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: NGoldwyn Rodrigues <rgoldwyn@suse.de>
Signed-off-by: NJoel Becker <joel.becker@oracle.com>
上级 812e7a6a
...@@ -1851,6 +1851,7 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb, ...@@ -1851,6 +1851,7 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
if (ret) if (ret)
goto out_dio; goto out_dio;
count = ocount;
ret = generic_write_checks(file, ppos, &count, ret = generic_write_checks(file, ppos, &count,
S_ISBLK(inode->i_mode)); S_ISBLK(inode->i_mode));
if (ret) if (ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册