[Ocfs2-tools-devel] [PATCH] Don't account space used for system files when disabling sparse feature

Joel Becker Joel.Becker at oracle.com
Tue Oct 13 16:19:24 PDT 2009


On Mon, Sep 07, 2009 at 11:28:50PM +0200, Jan Kara wrote:
> System files (except for root directory) are not accounted in quota. So we
> should not add the space used to fill holes in them when disabling sparse
> feature.
> 
> Signed-off-by: Jan Kara <jack at suse.cz>

Sob

> ---
>  tunefs.ocfs2/feature_sparse_files.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/tunefs.ocfs2/feature_sparse_files.c b/tunefs.ocfs2/feature_sparse_files.c
> index d4dff34..60e54c6 100644
> --- a/tunefs.ocfs2/feature_sparse_files.c
> +++ b/tunefs.ocfs2/feature_sparse_files.c
> @@ -509,7 +509,9 @@ static errcode_t fill_sparse_files(ocfs2_filesys *fs,
>  			if (ret)
>  				break;
>  		}
> -		if (di->i_clusters != file->old_clusters) {
> +		if (di->i_clusters != file->old_clusters && 
> +		    (!(di->i_flags & OCFS2_SYSTEM_FL) ||
> +		    file->blkno == super->s_root_blkno)) {
>  			long long change;
>  			ocfs2_cached_dquot *udquot = NULL, *gdquot = NULL;
>  
> -- 
> 1.6.0.2
> 

-- 

"You look in her eyes, the music begins to play.
 Hopeless romantics, here we go again."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list