When a large IO is done as a single buffer, there is no guarantee
that it will partially succeed when close to ENOSPC. The test
assumes that the kernel is going to break the write down into
smaller chunks (i.e. buffered IO breaking it down into PAGE_SIZE
allocations), but certain configurations will not do this. e.g.
extent size hints are set or DAX is being used) and hence the large
write fails completely as there is not space for the entire
allocation to be made.
Hence break the final write in the test up into multiple small
writes, thereby acheiving the same effect - ensuring that we can
write more data after removing some space....
Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>