public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix xfs_fsr insufficient space check
@ 2009-01-02 10:03 Chris Wedgwood
  2009-01-02 12:00 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Wedgwood @ 2009-01-02 10:03 UTC (permalink / raw)
  To: xfs

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@f00f.org>


--- 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)) {
 		fsrprintf(_("insufficient freespace for: %s: "
-			"size=%lld: ignoring\n"), fname, statp->bs_size);
+			"size=%lld: ignoring\n"), fname, statp->bs_blksize * statp->bs_blocks);
 		return 1;
 	}
 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-02 12:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-02 10:03 [PATCH] fix xfs_fsr insufficient space check Chris Wedgwood
2009-01-02 12:00 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox