Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fio verify breaks in the presence of short writes not aligned with blocksize #1830

Open
koverstreet opened this issue Oct 17, 2024 · 0 comments

Comments

@koverstreet
Copy link

koverstreet commented Oct 17, 2024

To reproduce: run xfstests generic/299 on bcachefs; optionally change verify method to meta

It will fail like so: fio is complaining about a bad magic header at an offset not aligned to fio's blocksize, and it never wrote a verify_header there.

changing the blocksize for the verify jobs to 512 (matching filesystem blocksize) causes the test to pass.

  • output mismatch (see /ktest-out/xfstests/generic/299.out.bad)
    mv: failed to preserve ownership for '/ktest-out/xfstests/generic/299.out.bad': Operation not permitted
    --- tests/generic/299.out 2017-03-18 04:22:34.053459304 +0000
    +++ /ktest-out/xfstests/generic/299.out.bad 2024-10-17 05:12:45.000000000 +0000
    @@ -3,3 +3,41 @@
    Run fio with random aio-dio pattern

    Start fallocate/truncate loop
    +verify: bad magic header e1a3, wanted acca at file /mnt/scratch/buffered-aio-verifier offset 6782324224, length 4096 (requested block: offset=6782324224, length=4096)

    •   hdr_fail data dumped as buffered-aio-verifier.6782324224.hdr_fail                                                                                                                                                                                                                                                     
      

    +verify: bad magic header c2f2, wanted acca at file /mnt/scratch/buffered-aio-verifier offset 693197312, length 4096 (requested block: offset=693197312, length=4096)

    •   hdr_fail data dumped as buffered-aio-verifier.693197312.hdr_fail                                                                                                                                                                                                                                                      
      

    ...
    (Run 'diff -u /host/home/kent/ktest/tests/fs/xfstests/tests/generic/299.out /ktest-out/xfstests/generic/299.out.bad' to see the entire diff)
    /ktest-out/xfstests/generic/299.full:
    fio --ioengine=libaio --bs=128k --directory=/mnt/scratch --filesize=25769803776 --size=999G --iodepth=1281 --continue_on_error=write --ignore_error=,ENOSPC --error_dump=0 --create_on_open=1 --fallocate=none --exitall=1 --name=direct_aio --direct=1 --buffered=0 --numjobs=4 --rw=randwrite --runtime=1001 --time_based --na
    me=aio-dio-verifier Option verifysort is deprecated
    --numjobs=1 --verify=meta --verify_fatal=1 --verify_dump=1 --verify_backlog=1024 --verify_async=4 --verifysort=1 --direct=1 --bs=4k --rw=randrw --filename=aio-dio-verifier --name=buffered-aio-verifier Option verifysort is deprecated
    --numjobs=1 --verify=meta --verify_fatal=1 --verify_dump=1 --verify_backlog=1024 --verify_async=4 --verifysort=1 --direct=0 --buffered=1 --bs=4k --rw=randrw --filename=buffered-aio-verifier
    ###########

299 test fio activity

Filenames derived from jobsname and jobid like follows:

..

[global]
ioengine=libaio
bs=128k
directory=/mnt/scratch
filesize=25769803776
size=999G
iodepth=128*1
continue_on_error=write
ignore_error=,ENOSPC
error_dump=0
create_on_open=1
fallocate=none
exitall=1

Perform direct aio, to files which may be truncated

by external task

[direct_aio]
direct=1
buffered=0
numjobs=4
rw=randwrite
runtime=100*1
time_based

Perform direct aio and verify data

This test case should check use-after-free issues

[aio-dio-verifier]
numjobs=1
verify=meta
verify_fatal=1
verify_dump=1
verify_backlog=1024
verify_async=4
verifysort=1
direct=1
bs=4k
rw=randrw
filename=aio-dio-verifier

Perform buffered aio and verify data

This test case should check use-after-free issues

[buffered-aio-verifier]
numjobs=1
verify=meta
verify_fatal=1
verify_dump=1
verify_backlog=1024
verify_async=4
verifysort=1
direct=0
buffered=1
bs=4k
rw=randrw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant