[Ocfs2-devel] Initialize count in aio_write before generic_write_checks

Sunil Mushran sunil.mushran at oracle.com
Mon Jul 13 11:01:07 PDT 2009


Goldwyn Rodrigues wrote:
> 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 in uninitialized.
>
> Signed-off-by: Goldwyn Rodrigues <rgoldwyn at suse.de>
>   

Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>



> diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
> index a5887df..5b9c8af 100644
> --- a/fs/ocfs2/file.c
> +++ b/fs/ocfs2/file.c
> @@ -1841,6 +1841,7 @@ relock:
>  		if (ret)
>  			goto out_dio;
>  
> +		count = ocount;
>  		ret = generic_write_checks(file, ppos, &count,
>  					   S_ISBLK(inode->i_mode));
>  		if (ret)
>
>   




More information about the Ocfs2-devel mailing list