Skip to content

Commit 0fc226e

Browse files
Bill O'DonnellZorro Lang
Bill O'Donnell
authored and
Zorro Lang
committed
fstests: generic/352 should accomodate other pwrite behaviors
xfs_io pwrite issues a series of block size writes, but there is no guarantee that the resulting extent(s) will be singular or contiguous. This behavior is acceptable, but the test is flawed in that it expects a single extent for a pwrite. Modify test to limit pwrite and reflink to a single block. Signed-off-by: Bill O'Donnell <[email protected]> Reviewed-by: Eric Sandeen <[email protected]> Signed-off-by: Zorro Lang <[email protected]>
1 parent 9445d70 commit 0fc226e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tests/generic/352

+6-4
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,24 @@ _require_xfs_io_command "fiemap"
2828
_scratch_mkfs > /dev/null 2>&1
2929
_scratch_mount
3030

31-
blocksize=$((128 * 1024))
31+
blocksize=$(_get_file_block_size $SCRATCH_MNT)
3232
_require_congruent_file_oplen $SCRATCH_MNT $blocksize
3333
file="$SCRATCH_MNT/tmp"
3434

3535
# Golden output is for $LOAD_FACTOR == 1 case
36+
# and assumes a normal blocksize of 4K
3637
orig_nr=8192
37-
orig_last_extent=$(($orig_nr * $blocksize / 512))
38-
orig_end=$(($orig_last_extent + $blocksize / 512 - 1))
38+
orig_blocksize=4096
39+
orig_last_extent=$(($orig_nr * $orig_blocksize / 512))
40+
orig_end=$(($orig_last_extent + $orig_blocksize / 512 - 1))
3941

4042
# Real output
4143
nr=$(($orig_nr * $LOAD_FACTOR))
4244
last_extent=$(($nr * $blocksize / 512))
4345
end=$(($last_extent + $blocksize / 512 - 1))
4446

4547
# write the initial block for later reflink
46-
_pwrite_byte 0xcdcdcdcd 0 $blocksize $file | _filter_xfs_io
48+
_pwrite_byte 0xcdcdcdcd 0 $blocksize $file > /dev/null
4749

4850
# use reflink to create the rest of the file, whose all extents are all
4951
# pointing to the first extent

tests/generic/352.out

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
QA output created by 352
2-
wrote 131072/131072 bytes at offset 0
3-
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
4-
0: [0..2097151]: shared
5-
1: [2097152..2097407]: shared|last
2+
0: [0..65535]: shared
3+
1: [65536..65543]: shared|last

0 commit comments

Comments
 (0)