Eric Sandeen c8afb44682 ext4: flush delalloc blocks when space is low
Creating many small files in rapid succession on a small
filesystem can lead to spurious ENOSPC; on a 104MB filesystem:

for i in `seq 1 22500`; do
    echo -n > $SCRATCH_MNT/$i
    echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > $SCRATCH_MNT/$i
done

leads to ENOSPC even though after a sync, 40% of the fs is free
again.

This is because we reserve worst-case metadata for delalloc writes,
and when data is allocated that worst-case reservation is not
usually needed.

When freespace is low, kicking off an async writeback will start
converting that worst-case space usage into something more realistic,
almost always freeing up space to continue.

This resolves the testcase for me, and survives all 4 generic
ENOSPC tests in xfstests.

We'll still need a hard synchronous sync to squeeze out the last bit,
but this fixes things up to a large degree.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-12-23 07:58:12 -05:00
..
2009-06-11 21:36:14 -04:00
2009-12-10 15:02:50 +01:00
2009-07-12 12:22:34 -07:00
2009-06-17 00:36:36 -04:00
2009-12-10 09:59:23 +02:00
2009-07-12 12:22:34 -07:00
2009-12-15 08:53:10 -08:00
2009-12-16 07:20:06 -08:00
2009-12-22 12:27:35 -05:00
2009-12-20 20:19:51 -08:00
2009-12-17 11:03:25 -05:00
2009-12-16 07:20:18 -08:00
2009-06-17 00:36:37 -04:00
2009-12-17 11:03:25 -05:00
2009-12-14 21:40:04 +01:00
2009-12-16 07:20:06 -08:00
2009-12-17 11:03:25 -05:00
2009-12-16 07:20:13 -08:00
2009-12-22 12:27:34 -05:00
2009-09-24 08:41:47 -04:00
2009-09-24 07:21:03 -07:00
2009-12-17 04:52:13 -05:00
2009-12-17 11:03:25 -05:00
2009-04-07 08:31:16 -07:00
2009-12-22 12:27:34 -05:00
2009-12-14 18:12:11 -05:00
2009-12-22 12:27:34 -05:00
2009-12-17 10:51:40 -05:00
2009-10-04 15:05:10 -07:00
2009-12-16 12:16:49 -05:00