xfs/196: check for delalloc blocks after pwrite
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 8 Oct 2019 01:03:11 +0000 (18:03 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 13 Oct 2019 13:01:41 +0000 (21:01 +0800)
This test depends on the pwrite creating delalloc blocks, which doesn't
happen if the scratch fs is mounted in dax mode (or has an extent size
hint applied).  Therefore, check for delalloc blocks and _notrun if we
didn't get any.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/xfs/196

index 5dc28670d63da9bd1ef788e13cfa039374858cfe..406146c5f70fd922c7e0663312e8da3b7eeb00f9 100755 (executable)
@@ -50,6 +50,8 @@ bytes=$((64 * 1024))
 
 # create sequential delayed allocation
 $XFS_IO_PROG -f -c "pwrite 0 $bytes" $file >> $seqres.full 2>&1
+$XFS_IO_PROG -c "bmap -elpv" $file | grep -q delalloc || \
+       _notrun "Unable to create delayed allocations"
 
 # Enable write drops. All buffered writes are dropped from this point on.
 _scratch_inject_error "drop_writes" 1