generic: Test RWF_NOWAIT

Tests the RWF_NOWAIT flag so the I/O returns immediately with
-EAGAIN on a new file since it requires block allocation.

It creates a file, syncs it, and overwrites the file with
RWF_NOWAIT.  This should succeed.

Finally, read the contents to make sure the overwrite is successful.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Goldwyn Rodrigues
2017-12-07 10:00:43 -06:00
committed by Eryu Guan
parent eef2209b4f
commit 6a2fd57fb8
3 changed files with 89 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
QA output created by 471
pwrite: Resource temporarily unavailable
wrote 8388608/8388608 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
RWF_NOWAIT time is within limits.
00000000: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................
*
00200000: bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb ................
*
00300000: aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ................
*
read 8388608/8388608 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)