xfs
[Top] [All Lists]

Re: [PATCH] fix xfs_fsr insufficient space check

To: Chris Wedgwood <cw@xxxxxxxx>
Subject: Re: [PATCH] fix xfs_fsr insufficient space check
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Fri, 2 Jan 2009 07:00:00 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20090102100306.GA36830@xxxxxxxxxxxxxxxxxx>
References: <20090102100306.GA36830@xxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.18 (2008-05-17)
On Fri, Jan 02, 2009 at 02:03:06AM -0800, Chris Wedgwood wrote:
> The xfs_fsr insufficient check should consider the blocks used not the
> file length.  Without this change it is not possible to reorganize
> sparse files when file size exceeds the free space.
> 
> Signed-off-by: Chris Wedgwood <cw@xxxxxxxx>
> 
> 
> --- fsr/xfs_fsr.c.orig        2009-01-02 01:51:03.049181411 -0800
> +++ fsr/xfs_fsr.c     2009-01-02 01:53:56.297180891 -0800
> @@ -912,9 +912,9 @@
>       }
>       bsize = vfss.f_frsize ? vfss.f_frsize : vfss.f_bsize;
>  
> -     if (statp->bs_size > ((vfss.f_bfree * bsize) - minimumfree)) {
> +     if ((statp->bs_blksize * statp->bs_blocks) > ((vfss.f_bfree * bsize) - 
> minimumfree)) {

I'll put this after fixing the line length and removing all the
superflous braces.  Also we probably want a comment that bs_blksize
in xfs_bstat_t actually is the blocksize, unlike st_blksize in struct
stat.

<Prev in Thread] Current Thread [Next in Thread>