[Ocfs2-devel] [PATCH 2/4] ocfs2: use allocation reservations during file write

Tao Ma tao.ma at oracle.com
Tue Mar 16 02:19:25 PDT 2010


Hi Mark,
Mark Fasheh wrote:
> Add a per-inode reservations structure and pass it through to the
> reservations code.
> 
> Signed-off-by: Mark Fasheh <mfasheh at suse.com>
> ---
>  fs/ocfs2/alloc.c |    2 ++
>  fs/ocfs2/aops.c  |    2 ++
>  fs/ocfs2/file.c  |    3 +++
>  fs/ocfs2/inode.c |    4 ++++
>  fs/ocfs2/inode.h |    2 ++
>  fs/ocfs2/super.c |    2 ++
>  6 files changed, 15 insertions(+), 0 deletions(-)
<snip>
> 
> diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
> index 7e9df11..137d460 100644
> --- a/fs/ocfs2/aops.c
> +++ b/fs/ocfs2/aops.c
> @@ -1734,6 +1734,8 @@ int ocfs2_write_begin_nolock(struct address_space *mapping,
>  			goto out;
>  		}
>  
> +		data_ac->ac_resv = &OCFS2_I(inode)->ip_la_data_resv;
> +
Here is a bug. In case, we are writing the unwritten extents, we don't 
have a valid data_ac.
>  		credits = ocfs2_calc_extend_credits(inode->i_sb,
>  						    &di->id2.i_list,
>  						    clusters_to_alloc);

Regards,
Tao



More information about the Ocfs2-devel mailing list