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

fix wrong offset and length for verification type without header #1709

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

onkrasnov
Copy link
Contributor

@onkrasnov onkrasnov commented Jan 28, 2024

fix wrong offset and length for verification type without header

During a pattern verification error, 'hdr' points the beginning of a block filled with a pattern and error log has incorrect values.

Signed-off-by: Oleg Krasnov [email protected]

@onkrasnov onkrasnov changed the title fix wrong offset for VERIFY_PATTERN_NO_HDR fix wrong offset and length for verification type without header Jan 29, 2024
@vincentkfu
Copy link
Collaborator

Before patch:

root@localhost:~/fio-dev/fio-canonical# ./fio --name=test --filesize=512 --bs=512 --verify_pattern=1 --verify=pattern --rw=write
test: (g=0): rw=write, bs=(R) 512B-512B, (W) 512B-512B, (T) 512B-512B, ioengine=psync, iodepth=1
fio-3.36-51-g90a0
Starting 1 process

test: (groupid=0, jobs=1): err= 0: pid=225392: Thu Feb  8 19:36:11 2024
  read: IOPS=1000, BW=500KiB/s (512kB/s)(512B/1msec)
    clat (nsec): min=22305, max=22305, avg=22305.00, stdev= 0.00
     lat (nsec): min=22567, max=22567, avg=22567.00, stdev= 0.00
    clat percentiles (nsec):
     |  1.00th=[22400],  5.00th=[22400], 10.00th=[22400], 20.00th=[22400],
     | 30.00th=[22400], 40.00th=[22400], 50.00th=[22400], 60.00th=[22400],
     | 70.00th=[22400], 80.00th=[22400], 90.00th=[22400], 95.00th=[22400],
     | 99.00th=[22400], 99.50th=[22400], 99.90th=[22400], 99.95th=[22400],
     | 99.99th=[22400]
  write: IOPS=500, BW=250KiB/s (256kB/s)(512B/2msec); 0 zone resets
    clat (nsec): min=984386, max=984386, avg=984386.00, stdev= 0.00
     lat (nsec): min=1018.6k, max=1018.6k, avg=1018602.00, stdev= 0.00
    clat percentiles (usec):
     |  1.00th=[  988],  5.00th=[  988], 10.00th=[  988], 20.00th=[  988],
     | 30.00th=[  988], 40.00th=[  988], 50.00th=[  988], 60.00th=[  988],
     | 70.00th=[  988], 80.00th=[  988], 90.00th=[  988], 95.00th=[  988],
     | 99.00th=[  988], 99.50th=[  988], 99.90th=[  988], 99.95th=[  988],
     | 99.99th=[  988]
  lat (usec)   : 50=50.00%, 1000=50.00%
  cpu          : usr=0.00%, sys=0.00%, ctx=2, majf=0, minf=13
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued rwts: total=1,1,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=1

Run status group 0 (all jobs):
   READ: bw=500KiB/s (512kB/s), 500KiB/s-500KiB/s (512kB/s-512kB/s), io=512B (512B), run=1-1msec
  WRITE: bw=250KiB/s (256kB/s), 250KiB/s-250KiB/s (256kB/s-256kB/s), io=512B (512B), run=2-2msec

Disk stats (read/write):
  sda: ios=0/0, sectors=0/0, merge=0/0, ticks=0/0, in_queue=0, util=0.00%
root@localhost:~/fio-dev/fio-canonical# ./fio --name=test --filesize=512 --bs=512 --verify_pattern=0 --verify=pattern
test: (g=0): rw=read, bs=(R) 512B-512B, (W) 512B-512B, (T) 512B-512B, ioengine=psync, iodepth=1
fio-3.36-51-g90a0
Starting 1 process
fio: got pattern '01', wanted '00'. Bad bits 1
fio: bad pattern block offset 0
pattern: verify failed at file test.0.0 offset 0, length 16843009 (requested block: offset=0, length=512, flags=8)
fio: verify type mismatch (257 media, 18 given)
fio: pid=225398, err=84/file:io_u.c:2175, func=io_u_sync_complete, error=Invalid or incomplete multibyte or wide character

test: (groupid=0, jobs=1): err=84 (file:io_u.c:2175, func=io_u_sync_complete, error=Invalid or incomplete multibyte or wide character): pid=225398: Thu Feb  8 19:36:20 2024
  read: IOPS=500, BW=250KiB/s (256kB/s)(512B/2msec)
    clat (nsec): min=722066, max=722066, avg=722066.00, stdev= 0.00
     lat (nsec): min=722836, max=722836, avg=722836.00, stdev= 0.00
    clat percentiles (usec):
     |  1.00th=[  725],  5.00th=[  725], 10.00th=[  725], 20.00th=[  725],
     | 30.00th=[  725], 40.00th=[  725], 50.00th=[  725], 60.00th=[  725],
     | 70.00th=[  725], 80.00th=[  725], 90.00th=[  725], 95.00th=[  725],
     | 99.00th=[  725], 99.50th=[  725], 99.90th=[  725], 99.95th=[  725],
     | 99.99th=[  725]
  lat (usec)   : 750=100.00%
  cpu          : usr=0.00%, sys=0.00%, ctx=1, majf=0, minf=20
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=50.0%, 4=50.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued rwts: total=1,0,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=1

Run status group 0 (all jobs):
   READ: bw=250KiB/s (256kB/s), 250KiB/s-250KiB/s (256kB/s-256kB/s), io=512B (512B), run=2-2msec

Disk stats (read/write):
  sda: ios=0/0, sectors=0/0, merge=0/0, ticks=0/0, in_queue=0, util=0.00%

The error message has a garbage length 16843009.

With the patch:

root@localhost:~/fio-dev/fio-1709# ./fio --name=test --filesize=512 --bs=512 --verify_pattern=0 --verify=pattern
test: (g=0): rw=read, bs=(R) 512B-512B, (W) 512B-512B, (T) 512B-512B, ioengine=psync, iodepth=1
fio-3.36-54-g9c8b9
Starting 1 process
fio: got pattern '01', wanted '00'. Bad bits 1
fio: bad pattern block offset 0
pattern: verify failed at file test.0.0 offset 0, length 512 (requested block: offset=0, length=512, flags=8)
fio: verify type mismatch (257 media, 18 given)
fio: pid=228517, err=84/file:io_u.c:2175, func=io_u_sync_complete, error=Invalid or incomplete multibyte or wide character

test: (groupid=0, jobs=1): err=84 (file:io_u.c:2175, func=io_u_sync_complete, error=Invalid or incomplete multibyte or wide character): pid=228517: Thu Feb  8 19:44:59 2024
  read: IOPS=500, BW=250KiB/s (256kB/s)(512B/2msec)
    clat (nsec): min=746308, max=746308, avg=746308.00, stdev= 0.00
     lat (nsec): min=747518, max=747518, avg=747518.00, stdev= 0.00
    clat percentiles (usec):
     |  1.00th=[  750],  5.00th=[  750], 10.00th=[  750], 20.00th=[  750],
     | 30.00th=[  750], 40.00th=[  750], 50.00th=[  750], 60.00th=[  750],
     | 70.00th=[  750], 80.00th=[  750], 90.00th=[  750], 95.00th=[  750],
     | 99.00th=[  750], 99.50th=[  750], 99.90th=[  750], 99.95th=[  750],
     | 99.99th=[  750]
  lat (usec)   : 750=100.00%
  cpu          : usr=0.00%, sys=0.00%, ctx=1, majf=0, minf=22
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=50.0%, 4=50.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued rwts: total=1,0,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=1

Run status group 0 (all jobs):
   READ: bw=250KiB/s (256kB/s), 250KiB/s-250KiB/s (256kB/s-256kB/s), io=512B (512B), run=2-2msec

Disk stats (read/write):
  sda: ios=0/0, sectors=0/0, merge=0/0, ticks=0/0, in_queue=0, util=0.00%

The error message has length 512

@axboe axboe merged commit 4e37a55 into axboe:master Feb 8, 2024
9 of 10 checks passed
@onkrasnov onkrasnov deleted the fix-offset branch February 9, 2024 05:12
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

Successfully merging this pull request may close these issues.

3 participants