This is a significant rework of 275, which made too many
assumptions about details of space usage and failed on several
filesystems (it passed on xfs, but only by accident).
This new version tries to leave about 256k free, then tries
a single 1M IO, and fails only if 0 bytes are written.
It also sends a lot more to $seq.full for debugging on failure,
doesn't rm -rf $SCRATC_MNT, and fixes a few other stylistic things.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
This test is for write-posix test. If writing a file when the disk is almost
full, the posix wants the call to write as much as possible but not none.
quote the POSIX:
If a write() requests that more bytes be written than there is room for
(for example, [XSI] [Option Start] the process' file size limit or
[Option End] the physical end of a medium), only as many bytes as there
is room for shall be written. For example, suppose there is space for 20
bytes more in a file before reaching a limit. A write of 512 bytes will
return 20. The next write of a non-zero number of bytes would give a
failure return (except as noted below).
Signed-off-by: Wu Bo <Wu.Bo@cn.fujitsu.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>